## 5 Conclusions  
In this study, we have successfully addressed the challenging task of pig face recognition by developing a comprehensive approach that leverages the strengths of deep learning models while considering the computational constraints of practical applications. Through \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Model** & **Accuracy** & **Precision** & **Recall** & **F1 Score** & **FLOPs** & **Parameters** \\ \hline MobileNet-V2 & 0.924 & 0.920 & 0.914 & 0.922 & 0.313 & 2.249 \\ ShuffleNet-V1 & 0.932 & 0.935 & 0.936 & 0.930 & 0.143 & 0.924 \\ ShuffleNet-V2 & 0.941 & 0.943 & 0.936 & 0.944 & 0.15 & 1.26 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Comparison of lightweight state-of-art student models for the pig face recognition task. Figure 13: Comparison of student models’ loss and Accuracy curves. \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Model** & **Accuracy** & **Precision** & **Recall** & **F1 Score** \\ \hline RKD & 0.968 & 0.972 & 0.972 & 0.972 \\ WSDD & 0.952 & 0.953 & 0.957 & 0.951 \\ KD & 0.960 & 0.962 & 0.967 & 0.966 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of state-of-art knowledge distillation methods applied in the pig face recognition task. the strategic selection of a Vision Transformer (ViT) as our teacher model and ShuffleNet-V2 as our student model, we have demonstrated the effectiveness of knowledge distillation in the domain of intelligent livestock management. Our method began with the curation of a high-quality pig face dataset, where we utilized a pre-trained YOLO-v8 model to detect and filter high-quality images from a large corpus of unannotated videos. This step not only significantly reduced the need for manual annotation but also ensured that the data used for training were of high fidelity, which is crucial for the success of any recognition task. The evaluation of various state-of-the-art knowledge distillation techniques showed that Relational Knowledge Distillation (RKD) was particularly effective in enhancing the performance of the lightweight ShuffleNet-V2 model. By distilling knowledge from the ViT, the student model achieved impressive Accuracy and F1 scores, making it highly suitable for deployment in resource-constrained environments. These results open up new possibilities for the application of AI in agriculture, particularly in the monitoring and management of livestock. In the practical application of our pig face recognition system, initially, pig face data are captured by cameras installed on the pig farm. These raw data are then processed through our filtering model, which selects high-quality images. Subsequently, these filtered images are processed by our pig face detection model to automatically generate pig face data. The final step involves our distilled lightweight recognition model predicting the unique ID of each pig. By automating the entire process of pig face recognition, our system significantly reduces the manual labor typically involved in monitoring and managing livestock. This not only leads to a reduction in operational costs but also enhances the accuracy of tracking and health management of each pig. The economic efficiency of our system is evident in its ability to process large data volumes quickly and accurately, making it an invaluable tool for modern smart farming practices. The integration of this technology in a farm setting translates into tangible benefits such as improved livestock management, better health monitoring, and enhanced productivity, all contributing to a more economically efficient farming operation. The ability to accurately recognize individual animals in a non-invasive manner can significantly contribute to the well-being and productivity of the animals, as well as the efficiency of farm operations. Future work may explore the integration of these models into a real-time monitoring system, the expansion of the dataset to include more diverse environmental conditions, and the adaptation of the approach to other animal recognition tasks.