# A Review of Posture Detection Methods for Pigs Using Deep Learning
## 2 Data Acquisition and Sub-Tasks for Pig Posture Detection
### Sub-Tasks for Image-Based Pig Posture Detection
#### 2.2.2 Posture Classification  
Posture classification refers to the assignment of a label from several prepared posture labels (such as standing, sitting, and lying, and their descriptions are enumerated in Table 1) to individual pigs detected in an image, as shown in Figure 4. The procedures of posture classification mainly comprise feature-extraction engineering and classification based on the extracted feature vectors by a trained classifier [54].  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Posture Type** & **Description** & **Reference** \\ \hline \multirow{2}{*}{Standing} & Upright body position on extended legs & \multirow{2}{*}{[29]} \\  & with hooves only in contact with the floor & \\ \hline \multirow{4}{*}{Ventral recumbency} & Lying on abdomen/sternum with front & \multirow{4}{*}{[29]} \\  & legs folded under the body and visible & \\ \cline{1-1} \cline{3-3}  & hind legs (right side, left side); udder is & partially obscured \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \cline{1-1} \cline{3-3}  & & \\ \hline \hline \end{tabular}
\end{table}
Table 1: Descriptions of pig postures in the existing literature.  
Before deep learning began to thrive in the field of machine vision, classifiers were commonly built on sophisticated handcrafted feature-extraction algorithms. Within them, the Zernike moment feature [59] is a common descriptor in early pig posture classification. The extracted features largely determine the classification performance of SVM, which has long been used for pig posture classification. In pig posture detection, due to the characteristics of translation, rotation, and scale invariance, the outline of pigs can serve as an effective and feasible feature representation. By inputting the Zernike moment feature extracted from the binary pig contours into an SVM classifier, four kinds of behavior postures of pigs can be recognized with a classification accuracy above 95% [40]. Similar to the above research, [PERSON] et al. [7] used the convex hull and boundaries of pigs as feature descriptors, obtaining a posture classification accuracy of 94.4% for two lying postures of grouped pigs.  
Due to the background noise caused by occlusion and overlapping among pigs, posture classification based on manually designed feature descriptors lacks robustness in a real pig farming environment. Using a convolution operation coupled with deep learning, more semantic, high-level, and deeper representation of the features can be realized through a deep convolutional neural network (CNN) [54] in contrast to the shallow feature representation of the traditional method. With the help of the self-learning system, such as the gradient descent algorithm [60; 61], the efficiency of feature extraction and classification can be greatly improved. Similar to the operation of [PERSON] et al., by introducing CNN to replace manual feature extraction, [PERSON] [35] inputted the depth distance and boundary data of detected pigs in the depth image into a six-layer deep CNN. As a result, effective feature representation could be automatically and efficiently achieved from high-dimensional data. At the final stage, these scientific and powerful feature vectors can be fed into an SVM classifier, and five postures can be classified with an overall high accuracy of 94.6368%.