TL;DR
Researchers have developed CClusnet-Inseg, a specialized instance segmentation framework designed to track piglets in farrowing pens despite extreme physical obstructions. By predicting object centers and using a refined clustering approach, the system achieves a mean Average Precision (mAP) of 84.1, significantly outperforming general-purpose models like Mask R-CNN in high-occlusion environments.
What Problem Does This Paper Address?
In precision livestock farming, monitoring piglet behavior is vital for health and welfare. However, the "farrowing crates" used on farms—metal structures designed to protect piglets from being crushed by the sow—create a nightmare for computer vision.
Standard instance segmentation models (like those trained on the COCO dataset) struggle with heavy occlusion. In a typical farrowing pen, a piglet might be split into two visible parts by a metal bar, or only a head might be visible while the rest of the body is under the sow. This leads to three common errors:
- Duplicate detection: One piglet is counted as two because it's split by a bar.
- Wrong association: A head is incorrectly "attached" to a nearby body.
- Incomplete detection: Parts of the animal are simply missed.
The authors note that occlusions occur in a staggering 97.7% of images in these environments, making standard "off-the-shelf" AI tools unreliable.
Methods
The authors adapted a "Center Clustering Network" (originally used for counting) into a two-stage segmentation pipeline called CClusnet-Inseg:
- Stage 1: The Neural Network: An encoder-decoder architecture processes the image to produce two outputs:
- A semantic segmentation map (identifying which pixels belong to piglets).
- A center offset vector map (where every pixel predicts the $(x, y)$ coordinates of the center of the piglet it belongs to).
- Stage 2: Clustering and Masking:
- DBSCAN Clustering: The predicted center points are grouped. The authors swapped the original "Mean-shift" algorithm for DBSCAN, which proved to be 20 times faster.
- C2M & RC2M: They introduced "Centers-to-Mask" (C2M) and "Remain-Centers-to-Mask" (RC2M) algorithms. RC2M is particularly clever—it takes pixels that the clustering algorithm initially rejected as "noise" and assigns them to the nearest valid cluster, ensuring that even fragmented parts of a piglet are included in the final mask.
Datasets
The study utilized a custom dataset rather than public benchmarks:
- Source: Six top-view videos from three closed and three half-open farrowing crates.
- Scale: 4,600 images total.
- Labels: Precise manual annotations for piglet centers, individual piglet masks, and sow masks.
- Conditions: The dataset specifically categorized occlusions into "Body-Separated Occlusion" (BSO) and "Part-Missing Occlusion" (PMO) to test the model's robustness.
Key Insights and Ideas
- Center-Point Robustness: Traditional models often rely on bounding boxes. By focusing on the object center as a representative point, the model creates a stable reference that remains consistent even if the animal's edges are obscured or split.
- The Speed-Accuracy Tradeoff: By moving from Mean-shift to DBSCAN, the researchers reduced clustering time from ~2.8 seconds per image to just ~0.15 seconds. While the RC2M step adds a tiny bit of computational overhead (2.2%), it provides a 1.3 mAP boost by recovering "lost" pixels.
- Beyond Just Masks: The predicted center isn't just a means to an end; it serves as an "occlusion-resistant" coordinate for Multi-Object Tracking (MOT), allowing the system to follow a piglet's trajectory even when its body shape is constantly changing due to obstructions.
Key Results
CClusnet-Inseg outperformed several state-of-the-art (SOTA) models:
- Accuracy: Achieved 84.1 mAP, beating YOLACT++ (80.9), CondInst (80.6), and the industry-standard Mask R-CNN (74.4).
- Qualitative Success: Visualizations show the model correctly identifying piglets in tight spaces between crates where other models either failed to detect them or produced "double detections."
- Application: The researchers successfully extracted behavioral metrics like trajectory, average speed, and spatial usage (e.g., how much time piglets spend on the heat pad vs. near the sow).
Limitations and Future Work
- Not End-to-End: The model still requires a separate clustering step after the neural network finishes its work. This makes the pipeline more complex and slightly slower than "one-stage" detectors.
- Inference Speed: At roughly 4 frames per second (FPS), the system is not yet capable of high-speed real-time processing, though it is sufficient for many monitoring tasks.
- Future Directions: The authors suggest exploring lighter backbones (like MobileNet) to increase speed and implementing more advanced tracking algorithms (like the Hungarian algorithm or Kalman filters) to improve long-term piglet identification.
Summary updated