Identifying individual pigs is crucial for efficient breeding, health management, and disease control in modern farming. Traditional animal face identification methods are labor-intensive and prone to inaccuracies, while existing CNN-based pig face recognition models often struggle with high computational demands, large sizes, and reliance on extensive labeled data, which limit their practical application. This paper addresses these challenges by proposing a novel, decoupled approach to pig face recognition that separates detection from identification. This strategy employs a detection model as a pre-processing step, significantly reducing the need for extensive re-annotation for new datasets. Additionally, the paper introduces a method that integrates offline knowledge distillation with a lightweight pig face recognition model, aiming to build an efficient and embedding-friendly system. To achieve these objectives, the study constructs a small-scale, high-quality pig face detection dataset consisting of 1500 annotated images from a selection of 20 pigs. An independent detection model, trained on this dataset, then autonomously generates a large-scale pig face recognition dataset with 56 pig classes. In the face recognition stage, a robust teacher model guides the student model through a distillation process informed by a knowledge distillation loss, enabling the student model to learn relational features from the teacher. Experimental results confirm the high accuracy of the pig face detection model on the small-scale detection dataset and the ability to generate a large-scale dataset for pig face recognition on unlabeled data. The recognition experiments further verify that the distilled lightweight model outperforms its non-distilled counterparts and approaches the performance of the teacher model. This scalable, cost-effective solution shows significant promise for broader computer vision applications beyond agriculture.
Effective pig farming relies on precise and adaptable animal identification methods, particularly in dynamic environments where new pigs are regularly added to the herd. However, pig face recognition is challenging due to high individual similarity, lighting variations, and occlusions. These factors hinder accurate identification and monitoring. To address these issues under Open-Set conditions, we propose a three-phase Pig Face Open-Set Recognition (PFOSR) system. In the Training Phase, we adopt a decoupled design, first training a YOLOv8-based pig face detection model on a small labeled dataset to automatically locate pig faces in raw images. We then refine a Vision Transformer (ViT) recognition model via a dual-loss strategy—combining Sub-center ArcFace and Center Loss—to enhance both inter-class separation and intra-class compactness. Next, in the Known Pig Registration Phase, we utilize the trained detection and recognition modules to extract representative embeddings from 56 identified pigs, storing these feature vectors in a Pig Face Feature Gallery. Finally, in the Unknown and Known Pig Recognition and Registration Phase, newly acquired pig images are processed through the same detection–recognition pipeline, and the resulting embeddings are compared against the gallery via cosine similarity. If the system classifies a pig as unknown, it dynamically assigns a new ID and updates the gallery without disrupting existing entries. Our system demonstrates strong Open-Set recognition, achieving an AUROC of 0.922, OSCR of 0.90, and F1-Open of 0.94. In the closed set, it attains a precision@1 of 0.97, NMI of 0.92, and mean average precision@R of 0.96. These results validate our approach as a scalable, efficient solution for managing dynamic farm environments with high recognition accuracy, even under challenging conditions.
In shrimp farming, determining the physical traits of shrimp is vital for assessing their health and growth. One of the critical traits is their size, as it serves as a key indicator of growth rates, biomass, and effective feed management. However, the accurate measurement of shrimp size is challenged by factors such as their naturally curved body posture, frequent overlapping among individuals, and their tendency to blend with the background, all of which hinder precise size estimation. Traditional methods for measuring the size of shrimp involve manual sampling, which is labor-intensive and time consuming. In contrast, image processing and classical computer vision techniques provide some reasonable results but often suffer from inaccuracies, making them unsuitable for large-scale monitoring. To address this problem, this paper proposes a dual-segmentation deep learning-based framework for accurately estimating shrimp size. It integrates instance segmentation using the RTMDet-m model with an enhanced semantic segmentation model to effectively predict the centerline of the shrimp’s body, enabling precise size measurements. The first stage employs the RTMDet-m model for the instance segmentation of shrimp, achieving an average precision () of 96% with fewer parameters and the highest frames per second (FPS) count among state-of-the-art models. The second stage utilizes our custom segmentation model for centerline predictive module, attaining the highest FPS and F1-score of 88.3%. The proposed framework achieves the lowest mean absolute error of 1.02 cm and a root mean square error of 1.27 cm in shrimp size estimation compared to the baseline methods discussed in comparative study sections. Our proposed dual-segmentation framework outperforms both traditional and deep learning based methods used for measuring shrimp size.
Accurate and reliable localization is crucial for autonomous systems operating in dynamic and semi-structured environments, such as precision agriculture and outdoor robotics. Advances in Global Navigation Satellite System (GNSS) technologies, particularly Differential GPS (DGPS) and Real-Time Kinematic (RTK) positioning, have significantly enhanced position estimation precision, achieving centimeter-level accuracy. However, GNSS-based localization continues to encounter inherent limitations due to signal degradation and intermittent data loss, known as GNSS outages. This paper proposes a novel complementary RTK-like position increment prediction model with the purpose of mitigating challenges posed by GNSS outages and RTK signal discontinuities. This model can be integrated with a Dual Extended Kalman Filter (Dual EKF) sensor fusion framework, widely utilized in robotic navigation. The proposed model uses time-synchronized inertial measurement data combined with the velocity inputs to predict GNSS position increments during periods of outages and RTK disengagement, effectively substituting for missing GNSS measurements. The model demonstrates high accuracy, as the total aDTW across 180 s trajectories averages at 1.6 m while the RMSE averages at 3.4 m. The 30 s test shows errors below 30 cm. We leave the actual Dual EKF fusion to future work, and here, we evaluate the standalone deep network.
Reliable assessment of livestock manure compost maturity is important for safe agricultural use, yet biological and laboratory-based indicators may not be consistently available during routine monitoring. This study developed and evaluated machine learning models for predicting a composite compost maturity score under five feature availability scenarios representing complete, reduced, monitoring-oriented, and low-cost input conditions. Separately, target definition considerations were addressed by treating the complete-input setting as an upper-bound reference and excluding germination index (GI) and explicit carbon-to-nitrogen (C/N) ratio variable from the reduced scenarios because of their direct or indirect relationship with score construction. Individual regression models, stacking and weighted ensembles, and a multilayer perceptron were compared using 30 repeated 80/20 train–test splits. The selected reduced-feature stacking model achieved a mean test R2 of 0.920 ± 0.020, while the monitoring-oriented setting achieved an R2 of 0.869 ± 0.035 using fewer routinely measurable inputs. Feature-group ablation and simulated Gaussian noise testing examined model dependence and measurement sensitivity, while permutation importance, Shapley additive explanations (SHAP), and accumulated local effects (ALE) provided complementary interpretation of influential variables and response patterns. Exploratory supplementary interpolation and LSTM/GRU experiments further explored data augmentation and temporal modeling feasibility. Overall, the study demonstrates accurate and interpretable maturity score prediction across reduced and monitoring-oriented feature settings.