Both farmers and engineers collaborate and improve pig welfare conditions with pig emotion recognition (PER). Applying the PER can reduce the amount of labor expenditure and stress among domestic pigs without frequent human intervention. However, the unprocessed PER dataset could have a limitation in improving the real-life evaluation since many samples in the PER dataset contain irrelevant pig features hindering real-time performance improvement. Besides, most PER datasets are generated by sequential pig images from recorded video clips. Fully shuffling the sequentially generated data samples between training and testing groups generate an improper experimental evaluation. In this paper, we propose a semi-shuffle technique and a pig detector based on the Megadetector version 3 to better represent real-time performance and improve performance
from unbiased experimental results. In this paper, our proposed semi-shuffles and pig detector significantly affected the performance of the PER system and unveiled an actual classifying performance. The developed Artificial Intelligence based model enables rapid, automated and precise recognition and detection of varying classes of emotions in farmed animals such as pigs.