Abstract:Abstract: Timely and accurate identification of oestrus behavior of sows can effectively increase the conception rate and litter size, which is of great significance to improve the breeding level and economic benefits of breeding enterprises.The traditional identification methods of oestrus behavior of sows have the problems of high working intensity, strong subjectivity and low automation level. Some identification methods of oestrus behavior of sows based on internet of things also have some problems, such as high false alarm times, high error rate and long recognition time. In order to solve the problems of low identification accuracy and efficiency, a oestrus behavior recognition method of sows based on Moth-Flame Optimization optimized Long Short Term Memory(MFO-LSTM) was proposed in this paper, and the verification test was carried out at WuFeng breeding farm in Xinghualing district, Taiyuan city, Shanxi Province. The posture data of sows were obtained by posture sensors installed on the neck of the sows. The posture data describing the sow's motion state contained three-axis acceleration, three-axis angular velocity, three-axis angle, three-axis magnetic field and quaternion. The collected posture data was manually marked according to the videos, and preprocessed to obtain a posture classification data set. Then, the MFO algorithm was used to optimize the numbers of first and second hidden layer neurons, maximum training period, block size and learning rate, thus, the LSTM network model was built. Postures of sows were divided into three categories, i.e. standing, lying and mounting. Through the statistics of the duration of each complete mounting behavior of the sows, the range of the recognition time of the oestrus behavior was obtained. The sows posture classification results were counted with different oestrus behavior recognition duration, and two characteristics of mounting behavior and activity were then extracted, so as to obtain the recognition feature matrix of oestrus behavior of sows. Finally, the feature matrix was input into the MFO-LSTM classification model to judge whether the sow was oestrus. The experimental results showed that the classification method of sows posture proposed could effectively distinguish the three postures of standing, lying and mounting. The classification effects of proposed method were better than that of the Support Vector Machine (SVM), Probabilistic Neural Network(PNN), Learning Vector Quantization (LVQ) and Extreme Learning Machine(ELM). The average accuracy, recall rate and F1 in the attitude data set were 98.02%, 96.26% and 96.18, respectively. On the basis of accurately identifying the sows' posture, the effect of oestrus behavior recognition based on MFO-LSTM algorithm was verified. The test results showed that the recognition effect was best when the oestrus recognition duration was 30 min at this time, the error rate, recall rate and specificity of oestrus recognition were 13.43%, 90.63% and 81.63%, respectively. The oestrus behavior of sows recognition method proposed effectively reduced the error rate while maintaining a high recall rate and specificity. Compared with other methods, the error rate was reduced by more than 80%, the oestrus behavior of sow could be recognized after 30 min of oestrus.