Next Article in Journal
DoseFormer: Dynamic Graph Transformer for Postoperative Pain Prediction
Next Article in Special Issue
Long-Term Prediction Model for NOx Emission Based on LSTM–Transformer
Previous Article in Journal
Deep Learning-Enabled Improved Direction-of-Arrival Estimation Technique
Previous Article in Special Issue
Deconvolutional Neural Network for Generating Spray Trajectory of Shoe Soles
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Classification and Recognition of Goat Movement Behavior Based on SL-WOA-XGBoost

1
College of Electronic Information Engineering, Inner Mongolia University, Hohhot 010021, China
2
Inner Mongolia Electric Power Survey and Design Institute Co., Ltd., Hohhot 010021, China
3
Etuoke Banner Brand Promotion Service Center in Etuoke Banner Agriculture and Animal Husbandry Bureau, Ordos 010300, China
4
State Key Laboratory of Reproductive Regulation and Breeding of Grassland Livestock, Hohhot 010020, China
*
Author to whom correspondence should be addressed.
Electronics 2023, 12(16), 3506; https://doi.org/10.3390/electronics12163506
Submission received: 26 June 2023 / Revised: 31 July 2023 / Accepted: 9 August 2023 / Published: 18 August 2023
(This article belongs to the Special Issue Applications of Deep Learning Techniques)

Abstract

:
Aiming at the problem of time-consuming, labor-intensive, and low-accuracy monitoring of goat motion behavior (lying, standing, walking, and running) while relying on the three-axis acceleration sensor and taking the acceleration data obtained from the goat back collection point as the research object, a method based on social learning (SL) is proposed using the Whale Optimization Algorithm (WOA) and XGBoost for goat motion behavior recognition. In this method, the XGBoost parameters are optimized by the WOA combined with social learning strategies to improve the classification and recognition accuracy. The results show that the recognition rate of lying behavior was as high as 97.14%, and the average recognition rate of the four movement behaviors was 94.42%, meeting the requirements of goat motion behavior recognition. Compared with the conventional XGBoost algorithm, the average recognition rate was increased by 3.41% and the recognition accuracy was improved. The results of this study can provide a reference for goat health assessment and intelligent disease warning.

1. Introduction

The abundant grassland resources of Inner Mongolia have allowed the sheep husbandry industry to flourish, which has greatly promoted the economic development of the region [1]. In recent years, while the method of breeding sheep has gradually changed from traditional stocking to large-scale house feeding and captivity, the method of breeding goats has gradually changed from traditional stocking to large-scale breeding, the density of goat herds has increased, their movement space has gradually been compressed, and it is difficult to guarantee a sufficient amount of exercise and proper living environment, making goats extremely susceptible to diseases and affecting their growth and health [2,3]. At the early stage of disease, due to goats’ strong tolerance to illness, the onset of symptoms is not obvious, but after they become sick, the frequency and duration of their lying, standing, walking, and running behaviors will change. By observing the movement behavior of goats over time, their health status can be indirectly predicted, and then appropriate response measures can be taken in time to ensure their health.
The traditional method is to observe the behavior of animals based on the experience of breeders, but this requires a lot of manpower, with high work intensity and extremely low efficiency, which can no longer meet the needs of large-scale breeding [4]. With technological developments and updates, visual detection has gradually transitioned to automatic monitoring. At present, mainstream automatic monitoring methods are mainly based on various sensors to establish a data-driven identification model, which has been widely used. Liu collected acceleration data with three-axis acceleration acquisition nodes and identified four behaviors of ewes (standing before giving birth, walking, lying down, and planning the ground) based on K-means and BP algorithms [5]. Martiskainen fixed three-axis acceleration sensors on the necks of cows and applied the SVM model to classify and identify their locomotion behavior [6]. Ren used the firefly algorithm to optimize the parameters of the SVM model, which improved the recognition accuracy [7].
Although the above classification methods have obtained good classification results, there are still some problems. (1) There are multiple empirical parameters when establishing the classification model, such as the penalty coefficient of the SVM model, which makes it difficult to optimize the prediction results. (2) The model has no regularization term in the learning process, which makes it prone to overfitting. (3) Restricted by the algorithm itself, training a large number of data samples is inefficient. To solve these problems, scholars have proposed using the XGBoost model, which incorporates regularization terms and fitting refinement. In addition, the model can be used for parallel computing during training. Therefore, when dealing with large sample sizes, the calculating efficiency will not suffer serious degradation due to the increased capacity. Chen used the model to classify the feeding intensity of fish stocks and verified its effectiveness [8]. However, the XGBoost model also has the disadvantage of relying on experience to set some empirical parameters when modeling, and it is difficult to ensure that the model parameters are optimal [9,10].
In order to ensure that the model parameters are optimal and further improve the recognition rate, in this paper, we use the WOA integrated with the social learning (SL) strategy to optimize the XGBoost model parameters and improve the model in terms of the optimization parameters [11]. The WOA in the paper is indeed the optimization algorithm, and it is used to optimize the optimal setup parameters of the XGBoost model, while the actual algorithm used for behavior classification is the XGBoost algorithm. We propose a hybrid model based on SL-WOA-XGBoost to classify and identify goats’ locomotion behavior, so as to improve the recognition rate and provide a basis for monitoring their health.

2. Behavioral Data Collection and Processing

2.1. Subjects

The trial was carried out at Yi Wei White Velvet Goat LLC in Inner Mongolia between 2020 and 2021. The 10-month-old Albas cashmere goats were in basically the same physical condition, healthy and disease-free. Each one wore a data collection device to obtain motor behavior data. During data collection, video surveillance equipment was used to simultaneously calibrate the behavior of goats, determine behavior categories, and verify the effect of the classification algorithm proposed in this paper based on the calibration results.

2.2. Data Acquisition

The MPU9250 three-axis acceleration sensor was selected for data acquisition in the test [12]. The collected data were transmitted to a PC through a wireless module, and then recorded and stored. The data acquisition device and collection point are shown in Figure 1. The data acquisition device is composed of the three-axis acceleration sensor module, a power module, and a wireless module, and is enclosed in a waterproof box, which is fixed on the goat’s back with straps. In this paper, we stipulate that when a test goat is wearing the data acquisition device and standing still, the positive direction of the X-axis is the direction pointing to the goat’s head, the positive direction of the Y-axis is the direction pointing to the right side of the goat’s body, and the positive direction of the Z-axis is vertical to the ground. The three positive directions are indicated in Figure 1b.

2.3. Data Processing

For collected raw data, noise reduction is often required [13]. In addition, considering that the position of the data acquisition device will change in the process of the goat’s movement, which will cause certain deviation in the acceleration values in three directions when standing still, it is necessary to correct the data [14]. The included angle between the Z-axis square of the sensor and gravitational acceleration g is  θ , the included angle  g  between the XOY reference plane and the positive direction of the X-axis is  α , and the values of the three-axis acceleration sensor in the static state in the X, Y, and Z directions are  a 1 x a 1 y , and  a 1 z , respectively. According to spatial geometry,  α  and  θ  can be expressed as follows:
α = arccos a 1 x a 1 x 2 + a 1 y 2 ,
θ = arccos a 1 x 2 + a 1 y 2 g .
The collected values of the three-axis acceleration sensor in the three directions are  a x a y , and  a z , and the corrected values  A x A y , and  A z  can be expressed as follows:
A x = ( a x sin α a y cos α ) sin θ + a y cos θ sin α ,
A y = ( a x cos α + a y sin α ) sin θ a y cos θ sin α ,
A z = a z sin θ a x cos θ + cos θ .
The acceleration values in the three directions before and after correction are shown in Figure 2. It can be seen that the corrected values are close to the values before correction.
The acceleration of different behaviors varies greatly in each direction. For example, goats may have smaller accelerations when lying and standing, and relatively larger accelerations when walking and running. The frequency characteristics of acceleration data for different behaviors are also different in all directions. Active behaviors such as walking and running produce higher frequency changes in acceleration, while stationary behaviors such as lying and standing may exhibit low-frequency or near-stable characteristics. Looking at the temporal relationship of accelerations under different behaviors can also help to distinguish them. For example, changes in acceleration in walking and running behaviors may have distinct repetitive patterns or periodicity, while lying and standing behaviors may exhibit relatively flat or no apparent periodicity. For goat behavior recognition, acceleration data alone may have certain limitations, so this paper added acceleration sensor data to improve the accuracy of behavior recognition. In addition, a machine learning training model, XGBoost, was built to learn and classify these behaviors.
Lying behavior: When the goat is lying, the motion amplitude is very small, and the acceleration value in the three directions is close to the initial value of the sensor. Standing behavior: When the goat stands, it is usually accompanied by feeding behavior, with a certain shift in the body, a certain change in the vertical direction, and a longer duration. Walking behavior: When the goat is walking, the acceleration value in the forward direction will change obviously. With the change of the forward direction, the lateral acceleration value will also change to some extent, and the vertical direction will change to some extent. Running behavior: When the goat is running, the acceleration in all three directions changes dramatically, especially in the vertical direction. With the goat jumping, the acceleration value in the vertical direction fluctuates more than the forward and lateral value changes.

3. Classification and Recognition of Goat Movement Behavior

3.1. XGBoost Algorithm

The XGBoost model is a machine learning model. Specifically, XGBoost is an ensemble learning algorithm that integrates multiple decision tree models and trains and optimizes the models through a gradient lifting algorithm to achieve multiple classification problems. When training the XGBost model, the main purpose is to determine the best tree structure, the core problem is to find an optimal split node, and the greedy algorithm is used to calculate the gain before and after the split to determine whether the node needs to be split. Then, each parameter of the generation optimization model is selected based on the objective function. The XGBoost model is finally obtained by training according to the above process, and the process of using this model for prediction is shown in Figure 3.
For a determined dataset E containing a sample of m-dimensional feature samples,  E = x 1 , y 1   x 2 , y 2   x n , y n , the result of the XGBoost model for the ith input  x i  can be expressed as
y ^ x i = y 0 x i + η k = 1 K x j = 1 T k ω j , k
where  y 0    is the basis classifier,  K x  is the number of iterations,  T k  is the number of classification and regression tree leaf nodes in the kth iteration,  ω j , k  is the sample substitute value corresponding to the jth node of the kth iteration,  η  is the learning rate.
The XGBoost model itself accepts the two-dimensional feature matrix as input, takes the goat movement behavior features extracted from the three-dimensional data as the columns of the input matrix, and takes the one-dimensional vector flattening the three-dimensional data as the rows of the input matrix. Then, the three-dimensional data can be converted into a two-dimensional matrix and passed to the XGBoost model as input for training and prediction.
When the XGBoost model is trained, the objective function to be optimized can be expressed as
L ϕ = i l y ^ i , y i + k Ω f k ,
k Ω f k = γ T + 1 2 λ j = 1 T k ω j 2
where  y i  is the true value,  l y ^ i , y i  is the loss function of  y ^ i  and  y i Ω f k  is a regular term,  γ  and  λ  are penalty factors;  T  is the number of child nodes of the CART tree, and  ω j  is the output score for the jth child node.
It can be seen from the above equation that there are many empirical parameters in XGBoost model training, such as learning rate  η , penalty coefficients  γ  and  λ , etc. If default coefficients are used, it is difficult to ensure the quality of model prediction results, so these parameters need to be optimized [10].
After the XGBoost model was trained for classification recognition, the test set contained 23,475 pieces of data, including 5941 related to lying behavior, 5455 related to standing behavior, 6151 related to walking behavior, and 5928 related to running behavior. The results of goat locomotion behavior recognition based on XGBoost are shown in Table 1 and Table 2.
From Table 1, it can be seen that the recognition rate of lying behavior is the highest at 93.97% and that of standing behavior is the lowest at 81.63%. This may be because the change of acceleration in the three directions during recumbent rest is relatively small compared to the other three types of behaviors, and the recognition rate of standing behavior is lower. Goats will be in a static state when they are standing, and the change in acceleration is small, which is similar to lying behavior. The average recognition rate of the four behaviors was only 89.37%, so there is room for further improvement.

3.2. WOA

The Whale Optimization Algorithm (WOA) is a search algorithm that simulates whale predation. It uses two methods to randomly engage in bubble-net attacks, and then uses this random behavior to achieve global search [15]. The WOA was used to increase the global search capability of the XGBoost model as well as the applicability of the algorithm, so that the XGBoost model combined with the WOA can be applied to other datasets in order to find the optimal solution or a near-optimal solution.
WOA is an optimization algorithm based on whale foraging behavior, while goat behavior recognition involves animal behavior recognition and image processing technology. The following is a basic framework for using WOA to achieve the identification of goat behavior. First of all, for data collection and labeling, it is necessary to collect and label a large number of goat behavior data, such as eating grass, running, lying, and other behaviors. Then, feature extraction is carried out, using XGBoost model to extract features from goat behavior images. The third step is data preprocessing, that is, noise reduction described in Section 2.3 of this paper. Finally, WOA training is carried out. The preprocessed features are taken as input and WOA is used for training. WOA simulates whale foraging behavior and searches for the best solution by adjusting the location of candidate solutions. Here, the candidate solution can be seen as a classifier or recognition model of goat behavior. WOA is an optimization algorithm that uses a portion of the labeled data set to evaluate the model and calculate metrics such as accuracy and recall rate. According to the evaluation results, the parameters of WOA or the structure of the model are adjusted to further optimize the model. Goat behavior recognition is designed to recognize the new goat behavior image through the trained model. After the image is input into the model, the model will output the corresponding behavior category, that is, realize the recognition of goat movement behavior.
The specific principles of the WOA are as follows:
(1)
Encircle prey
When searching for prey, since the location of prey is unknown, we first assume that the whale with the best fitness indicates the location of prey, and the rest of the individuals then approach the prey. The process can be expressed as follows:
D = C W t W t ,
W t + 1 = W t A D
where D is the encirclement compensation, C and A are random coefficient vectors,  W * t  is the optimal position vector under the number of iterations  t t  is the current number of iterations, and  W t + 1  is the  t + 1  generation position vector obtained after the next iteration update. During iteration, when a better solution emerges,  W * t  will be updated. A and C are calculated by the following equation:
A = 2 a r a a = 2 2 t t max ,
C = 2 r
where  α  is the control parameter, which decreases linearly from 2 to 0 as the number of iterations increases;  t m a x  is the set maximum number of iterations; and  r  is a random vector from 0 to 1.
(2)
Engage in hunting behavior
Hunting behavior is a process of approaching and gradually surrounding prey along a helix, which can be expressed as
D = W t W t ,
W t + 1 = D e b l cos 2 π l + W t
where  D  is the distance between whales and prey,  b  is a constant that controls the range of the helix, and  l  is a random number between −1 and 1.
At the same time as the whales surround the prey, the distance between the whales and the prey should also be reduced. A 50% probability is set to randomly select whether the whales will perform the spiral encirclement action or the narrow range action, that is, when the probability is random, they will perform the contraction encirclement action, and at that time will perform the distance reduction action. The specific process can be expressed as
W t + 1 = W * t A × D i f   p < 0.5 D × e b l × cos 2 π l + W * t ,   e l s e
where  p  is random probability with a value between 0 and 1.
(3)
Search for prey
In addition to hunting known prey, whales will also search for new prey, upon which they will enter the random search phase. Then, whales will be randomly selected to update the position, leaving the optimal individual position that each whale was given in the iteration process. The process can be expressed as
D = W t W t ,
W t + 1 = W r a n d t A D
where  W r a n d  is a random position vector.

3.3. Social Learning Strategies

Social learning strategies enable individuals with poor fitness in the whale population to learn from other whales with better fitness [16]. Based on the WOA, this paper proposes the Whale Optimization Algorithm with Social Learning Strategy (SL-WOA), which introduces the mechanism of cooperative learning and knowledge sharing based on the original algorithm to improve the search efficiency, accelerate the convergence process, and enhance the robustness and adaptability of the algorithm to better solve complex optimization problems. The specific process is described below and illustrated in Figure 4.
(1)
Initialize whale population parameter
The population size is determined by the following equation:
N = M + Q / 10
where  M  is the minimum number for normal operation of the algorithm,  Q  is a dimension, and [] is a remainder operation.
(2)
Sort
The fitness of the whales  P i , j t  is calculated and sorted in descending order. Fitness is measured by the recognition accuracy of XGBoost on the test set. The expression for identify accuracy is as follows:
A c c u r a c y = n p n × 100 %
where  n  is the total number of test samples and  n p  is the total number of types identified for correct classification. The final definition of  f i t n e s s  is
f i t n e s s = 1 A c c u r a c y .
(3)
Calculate social learning probability  P i L
Social learning probability  P i L  represents the learning ability of individual whales. When the random probability of the individual  p i t  is less than  P i L , the individual will engage in social learning. The calculation expression is as follows:
P i L = 1 i 1 N α log D M
where  i  is the fitness number, which is negatively related to fitness, meaning the larger  i  is, the lower an individual’s  f i t n e s s  is. It can be seen from the above formula that there is a certain relationship between  P i L  and  f i t n e s s  and the dimension of the optimization problem. The larger  i  is, the smaller  1 i 1 / N  is. This indicates that the individual is better and the ability to learn from other individuals is weak;  α · log D / N  also shows that there is a negative correlation between  P i L  and  D , that is, the larger  D  is, the smaller  P i L  is, that is, the greater the learning ability of individuals when optimizing high-dimensional problems, which is conducive to maintaining the diversity of the optimized population and preventing the population from falling into local optimization.
(4)
Calculate random probabilities
The variable  p i t  is used to update the positions of non-optimal individuals and is calculated as follows:
p i , j t = p i , j t 1 i f   p i t > P i L r 1 t P i , j t + Δ p i , j t ,   e l s e ,
Δ p i , j t = r 2 t I i , j t + r 3 t ε W i , j t ,
I i , j t = P k , j t P i , j t ,
W i , j t = G t P i , j t
where  r 1 t r 2 t , and  r 3 t  are random numbers between 0 and 1;  ε  is a social learning factor; and  Δ p i , j t  is a learning offset, which consists of local learning  I i , j t  and global learning  W i , j t . It can be seen that the updated position is determined by the local optimal position  P i , j t  and the three parts that represent the current individual’s learning behavior  I i , j t  from the better individual  k  and the current individual’s learning behavior  W i , j t  from the group as a whole, which is measured by the distance between  P i , j t  and  P k , j t . Finally,  W i , j t  is measured by the distance between the average optimal position  G t  of the individual and the group.
(5)
Update the location
By bringing Equations (21)–(23) into Equation (20), the individual positions can be updated.

3.4. Classification and Recognition Algorithm Flow Based on SL-WOA-XGBoost

The SL-WOA-XGBoost algorithm flow is as follows, and the flowchart is shown in Figure 5.
(1)
Initialize algorithm parameters, including WOA population number, iteration number, etc.
(2)
Initialize the population and calculate the fitness value for each individual in the population.
(3)
Sort individuals in descending according to the fitness value.
(4)
According to Equations (20)–(24), start from the individual with the greatest fitness to learn from the individual that is better than that one at random, and update its position:  P j d t + 1 = P j d t .
(5)
Calculate the individual fitness value after updating the position:  P j t > P j L t .
(6)
Determine whether the iteration termination conditions are met. If so, the global optimal solution will be output. Otherwise, return to step (3).
In order to quantitatively evaluate the classification effect of the optimized XGBoost model, the test set data used in Section 3 was used for testing, and the results are shown in Table 3 and Table 4.
From Table 3, it can be seen that the improved XGBoost model incorporating the SL-WOA strategy has the highest recognition rate of 97.14% for recumbent behaviors and the lowest recognition rate of 91.47% for standing behaviors, and the recognition rate is higher for walking behaviors than running behaviors, which is the same before and after the algorithms are improved. The recognition rate of standing behavior is the lowest for the XGBoost model before and after improvement, because the two algorithms incorrectly recognize standing behavior as lying down behavior, which may be because both behaviors tend to be stationary, with small acceleration changes and close acceleration values, which makes the classification and recognition incorrect. On the other hand, in the recognition of walking and running behaviors, walking was incorrectly identified as running and running was incorrectly identified as walking, which may be because the acceleration and posture of the goat change more during both walking and running.

4. Results and Analysis

A comparison of the recognition rates before and after the two algorithms are improved based on XGBoost and SL-WOA-XGBoost is shown in Table 5, and the comparison results of the two classification algorithms are shown in Figure 6.
The recognition effects of the XGBoost model before and after improvement are compared in Figure 6. It can be seen that the rate of correct recognition of standing behavior after improvement increased by 6.42%, and the correct recognition of standing behavior was significantly improved. The average recognition rate of the improved XGBoost model is 94.42%, which is 3.12% higher than before the improvement, indicating that the proposed strategy can improve the goat movement behavior recognition rate.
As can be seen from Table 5, the recognition rates of the four behaviors are improved by 2.51%, 6.42%, 1.98%, and 3.09%, and the average recognition rate is improved by 3.50%, among which the recognition rates of standing and walking behaviors are improved by 6.42% and 1.98% in the improved XGBoost model. This is a significant improvement in correct recognition of the two behaviors, and this result shows that the proposed strategy can improve the recognition rate of goat movement behavior, which verifies the effectiveness of the classification method described in this paper.

5. Conclusions

(1)
In this paper, a goat movement behavior monitoring system based on a collection point on the goat’s back is designed. The wearable data acquisition device, equipped with a three-axis acceleration sensor, is used to collect, transmit, and store goat movement behavior data in real time, which is of great significance for goat health monitoring and intelligent early disease warning.
(2)
WOA is just an optimization algorithm, the real algorithm for behavior classification is the XGBOOST model, and WOA is just used to select the optimal setting parameters for the XGBOOST model. The overall movement behavior identification process of goats is as follows: Firstly, data collection and labeling are carried out, that is, a large number of behavior data of goats’ standing, walking, running, and lying behaviors are collected and labeled; The next step is to perform feature extraction, using the XGBoost model to transform the 3D data into a 2D matrix that is passed to the XGBoost model for training and prediction. The third step is data preprocessing; the noise reduction process is described in Section 2.3 of this article. Finally, WOA is used to optimize the training and prediction results of the XGBoost model, simulate whale foraging behavior, and find the best solution by adjusting the location of candidate solutions. Here, the candidate solution can be viewed as a classifier or recognition model for goat behavior. WOA is an optimization algorithm that uses part of a labeled data set to perform model evaluations and calculate metrics such as accuracy, recall rates, and more. According to the evaluation results, the parameters of WOA or the structure of the model are adjusted to further optimize the model. Goat behavior recognition is used to recognize new goat behavior images by trained models. After the image is input into the model, the model will output the corresponding behavior category, that is, realize the recognition of goat movement behavior.
(3)
To solve the problem of low accuracy in goat movement recognition, a classification and recognition method based on SL-WOA-XGBoost is proposed. The WOA optimized by a social learning strategy is introduced to optimize the XGBoost parameters, and finally realize the classification and recognition of four behaviors: lying, standing, walking, and running. The experimental results show that the average accuracy of this method is 94.42%, which is 3.12% higher than that of the unmodified XGBoost model.

Author Contributions

Conceptualization, T.L. (Tingxia Li), T.L. (Tiankai Li) and D.H.; methodology, T.L. (Tingxia Li), T.L. (Tiankai Li) and D.H.; software, T.L. (Tingxia Li), T.L. (Tiankai Li) and R.S.; validation, T.L. (Tingxia Li), T.L. (Tiankai Li), J.X. and R.S.; formal analysis, T.L. (Tingxia Li), T.L. (Tiankai Li) and D.H.; investigation, T.L. (Tingxia Li) and T.L. (Tiankai Li); resources, T.L. (Tingxia Li), T.L. (Tiankai Li), D.H. and J.X.; data curation, T.L. (Tingxia Li) and T.L. (Tiankai Li); writing—original draft preparation, T.L. (Tingxia Li) and T.L. (Tiankai Li); writing—review and editing, T.L. (Tingxia Li), T.L. (Tiankai Li), D.H. and R.S.; visualization, T.L. (Tingxia Li), T.L. (Tiankai Li), J.X. and D.H.; supervision, D.H., J.X. and R.S.; project administration, T.L. (Tingxia Li), T.L. (Tiankai Li) and D.H.; funding acquisition, D.H. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the major science and technology projects of Inner Mongolia Autonomous Region under grant number 2021ZD0019-4. Sponsor Ding Han.

Data Availability Statement

Some or all of the data, models, or code generated or used during the study are available from the corresponding author by request (raw data, site data, algorithm model).

Acknowledgments

This work was supported by the major science and technology projects of Inner Mongolia Autonomous Region under GM 2021ZD0019-4. The authors would like to thank the funding bodies for their financial support.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Han, D. Research on the Detection and Identification Method of Grazing Behavior of Grassland Grazing Sheep. Ph.D. Thesis, Inner Mongolia Agricultural University, Hohhot, China, 2018. [Google Scholar]
  2. Xuan, C.; Wu, P.; Ma, Y.; Zhang, L.; Han, D.; Liu, Y. Vocal signal recognition of ewes based on power spectrum and formant analysis method. J. Agric. Eng. 2015, 31, 219–224. [Google Scholar] [CrossRef]
  3. Zhang, H.; Wu, Z.; Ban, F.; Yan, R.; Cao, W.; Zhao, X.; Zhang, X.; Gao, L.; Li, F. Construction of bio-safety system for large-scale sheep farm. Heilongjiang Anim. Husb. Vet. Med. 2017, 22, 76–79. [Google Scholar] [CrossRef]
  4. He, D.; Meng, F.; Zhao, K.; Zhang, Z. Recognition of Calf Basic Behaviors Based on Video Analysis. Trans. Chin. Soc. Agric. Mach. 2016, 47, 294–300. [Google Scholar] [CrossRef]
  5. Liu, Y.; Xuan, C.; Wu, P.; Zhang, L.; Zhang, Y.; Li, M. Classification and recognition on movement behaviors of ewes in house feeding environment based on K-means and BP neural network. J. China Agric. Univ. 2021, 26, 86–95. [Google Scholar] [CrossRef]
  6. Martiskainen, P.; Jarvanen, M.; Skon, J.; Tiirikainen, J.; Kolehmainen, M.; Mononen, J. Cow behavior pattern recognition using a three-dimensional accelerometer and support vector machines. Appl. Anim. Behav. Sci. 2009, 119, 32–38. [Google Scholar] [CrossRef]
  7. Ren, X.; Liu, G.; Zhang, M.; Si, Y.; Zhang, X.; Ma, L. Dairy Cattle’s Behavior Recognition Method Based on Support Vector Machine Classification Model. Trans. Chin. Soc. Agric. Mach. 2019, 50, 290–296. [Google Scholar]
  8. Chen, M.; Zhang, C.; Feng, G.; Chen, X.; Chen, G.; Wang, D. Intensity Assessment Method of Fish Feeding Activities Based on Feature Weighted Fusion. Trans. Chin. Soc. Agric. Mach. 2020, 51, 245–253. [Google Scholar]
  9. Gu, Y.; Zhang, D.; Bao, Z. Permeability prediction using PSO-XGBoost based on logging data. Oil Geophys. Prospect. 2021, 56, 26–37. [Google Scholar] [CrossRef]
  10. Yang, S.; Guo, M.; Zhao, L.; Li, Y. The method of 100-kernel weight related genes mining in maize mixed with genetic algorithm and XGBoost. CAAI Trans. Intell. Syst. 2022, 17, 170–180. [Google Scholar] [CrossRef]
  11. Li, T. A Study of Goat Movement Behavior Classification Recognition Based on Improved XGBoost Algorithm. Master’s Thesis, Inner Mongolia University, Hohhot, China, 2022. [Google Scholar] [CrossRef]
  12. Ying, Y.; Zeng, S.; Zhao, A.; Yan, F. Recognition method for prenatal behavior of ewes based on the acquisition nodes of the collar. Trans. Chin. Soc. Agric. Eng. (Trans. CSAE) 2020, 36, 210–219. [Google Scholar] [CrossRef]
  13. Zhang, X. Research on the Identification Method of Motor Behavior Characteristics of Rams in Facility Breeding; Inner Mongolia Agricultural University: Hohhot, China, 2018. [Google Scholar] [CrossRef]
  14. Liu, L.; Yang, S.; Wang, Z.; He, X.; Zhao, W.; Liu, S.; Du, W.; Mi, J. Prediction of coke quality based on improved WOA-LSTM. CIESC J. 2022, 73, 1291–1299. [Google Scholar] [CrossRef]
  15. Liu, Y. Study on the Identification Method of Typical Prenatal Behavior of Ewes in the Barn-Feeding Environment; Inner Mongolia Agricultural University: Hohhot, China, 2017. [Google Scholar]
  16. Yuan, X.; Jin, P.; Zhou, G. An Improved QPSO Algorithm Integrating Social Learning with Lévy Flights. Microelectron. Comput. 2019, 36, 364–373. [Google Scholar] [CrossRef]
Figure 1. (a) Data collection device (b) collection point for goat movement behavior.
Figure 1. (a) Data collection device (b) collection point for goat movement behavior.
Electronics 12 03506 g001
Figure 2. Comparison of data (a) before and (b) after correction.
Figure 2. Comparison of data (a) before and (b) after correction.
Electronics 12 03506 g002
Figure 3. XGBoost model prediction flowchart.
Figure 3. XGBoost model prediction flowchart.
Electronics 12 03506 g003
Figure 4. SL-WOA flowchart.
Figure 4. SL-WOA flowchart.
Electronics 12 03506 g004
Figure 5. SL-WOA-XGBoost algorithm flowchart.
Figure 5. SL-WOA-XGBoost algorithm flowchart.
Electronics 12 03506 g005
Figure 6. Comparison of classification and recognition results of two algorithms.
Figure 6. Comparison of classification and recognition results of two algorithms.
Electronics 12 03506 g006
Table 1. XGBoost classification and recognition results.
Table 1. XGBoost classification and recognition results.
Behavior
Category
Total Number of Sampling PointsNumber of
Lying Behavior Identifications
Number of Standing
Behavior
Identifications
Number of Walking
Behavior
Identifications
Number of Running
Behavior
Identifications
Single
Behavior Recognition Rate (%)
Average
Recognition Rate (%)
lying605156832061105294.7491.30
standing5388675435922313185.95
walking606185120539845893.26
running601972185228553491.26
Table 2. XGBoost Error classification results.
Table 2. XGBoost Error classification results.
Behavior
Category
Number of
Misclassifications
Number of
Incorrect
Recognitions of Lying Behavior
Number of
Incorrect
Recognitions of Standing Behavior
Number of
Incorrect
Recognitions of Walking Behavior
Number of
Incorrect
Recognitions of Running Behavior
lying358--60.3424.0215.64
standing100268.06--23.858.08
walking67013.7316.87--69.40
running46615.4534.7649.79--
Table 3. Classification results of motion behavior based on SL-WOA-XGBoost algorithm.
Table 3. Classification results of motion behavior based on SL-WOA-XGBoost algorithm.
Behavior
Category
Total Number of Sampling PointsNumber of
Lying
Behavior
Identifications
Number of Standing
Behavior
Identifications
Number of Walking
Behavior
Identifications
Number of Running
Behavior
Identifications
Single
Behavior Recognition Rate (%)
Average
Recognition Rate (%)
lying605156832061105297.1494.42
standing5388675435922313191.47
walking606185120539845895.05
running601972185228553494.02
Table 4. Error classification results.
Table 4. Error classification results.
Behavior
Category
Number of
Misclassifications
Number of Incorrect Recognitions of
Lying Behavior
Number of Incorrect Recognitions of Standing BehaviorNumber of Incorrect Recognitions of Walking BehaviorNumber of Incorrect Recognitions of Running Behavior
lying225--54.6728.4416.89
standing72669.01--21.639.37
walking25314.629.88--75.49
running32414.5137.3548.15--
Table 5. Comparison of recognition rate before and after improvement.
Table 5. Comparison of recognition rate before and after improvement.
Recognition Rate of Lying Behavior (%)Recognition Rate of Standing Behavior (%)Recognition Rate of Walking Behavior (%)Recognition Rate of Running Behavior (%)Average Recognition Rate (%)
XGBoost93.9786.6992.9292.0691.41
SL-WOA-XGBoost96.2191.8695.2393.6994.25
Promotion2.516.421.983.093.50
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Li, T.; Li, T.; Su, R.; Xin, J.; Han, D. Classification and Recognition of Goat Movement Behavior Based on SL-WOA-XGBoost. Electronics 2023, 12, 3506. https://doi.org/10.3390/electronics12163506

AMA Style

Li T, Li T, Su R, Xin J, Han D. Classification and Recognition of Goat Movement Behavior Based on SL-WOA-XGBoost. Electronics. 2023; 12(16):3506. https://doi.org/10.3390/electronics12163506

Chicago/Turabian Style

Li, Tingxia, Tiankai Li, Rina Su, Jile Xin, and Ding Han. 2023. "Classification and Recognition of Goat Movement Behavior Based on SL-WOA-XGBoost" Electronics 12, no. 16: 3506. https://doi.org/10.3390/electronics12163506

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop