Downloads · 30 days
121
41% of all-time downloads
marcosvmf/yolov8-piglife-sam3
yolov8-piglife-sam3 is a object detection model from marcosvmf. Use it when you need objects located in an image. It is set up for ultralytics. The card lists the license as cc-by-nc-4.0.
This repository provides the official YOLOv8 weights (Nano, Small, Medium) presented in our paper: SAM3-Assisted Training of Lightweight YOLO Models for Precision Pig Farming Marcos Vinicius Mendes Faria, Thiago Borge…
Downloads · 30 days
121
41% of all-time downloads
All-time downloads
295
Public
Repo size
81.5 MB
Likes
0
Public
Click a slice to open those files.
.pt81.3 MB · 100%
From the Hugging Face model README
This repository provides the official YOLOv8 weights (Nano, Small, Medium) presented in our paper:
SAM3-Assisted Training of Lightweight YOLO Models for Precision Pig Farming
Marcos Vinicius Mendes Faria, Thiago Borges Pereira, Isabella C. F. S. Condotta, Thiago Meireles Paixão, and Francisco de Assis Boldt. (2026)
arXiv: arXiv:2605.25860 | GitHub: mvmfaria/sam3-pseudo-label-pig-yolo
These models were trained entirely on pseudo-labels generated by the Segment Anything Model 3 (SAM3) applied to the PigLife dataset. They offer an off-the-shelf solution for precision livestock farming without needing to run heavy foundation models in production.
<p align="center"> <img src="cover.png" alt="SAM3 Training Pipeline" width="100%"/> </p>[!TIP]
Training Dataset
If you wish to train your own models from scratch, we have made the SAM3 pseudo-labels publicly available. Download the Dataset (Labels) Here
These models are lightweight and optimized for real-time inference on edge devices (like Raspberry Pi or Jetson Nano) as well as servers.
yolov8n-pig.pt (Nano) - Best for edge devices.yolov8s-pig.pt (Small) - Good balance of speed and accuracy.yolov8m-pig.pt (Medium) - Highest accuracy for server-side processing.You can use our trained models directly via the ultralytics package by passing the Hugging Face URL:
from ultralytics import YOLO
# Load the trained model directly from Hugging Face
model = YOLO("hf://marcosvmf/yolov8-piglife-sam3/yolov8s-pig.pt")
# Run inference on an image or video
results = model.predict("path/to/your/pig_image.jpg", save=True)
results[0].show()
Object detection performance on the test set comparing models trained on Human Annotations vs. SAM 3 Pseudo-labels, as well as the SAM 3 Zero-shot baseline:
| Supervision / Annotation | Model | Params (M) | Inf. Forward (ms) | Inf. Pipeline (ms) | mAP (50:95) | AP₅₀ | AP₇₅ | AP_M | AP_L |
|---|---|---|---|---|---|---|---|---|---|
| Human Annotated | YOLOv8n | 3.2 | 5.70 | 9.29 | 88.1 | 98.9 | 95.7 | 67.5 | 89.0 |
| Human Annotated | YOLOv8s | 11.2 | 6.10 | 9.51 | 90.6 | 99.0 | 96.9 | 72.1 | 91.4 |
| Human Annotated | YOLOv8m | 25.9 | 14.70 | 15.43 | 91.7 | 99.0 | 97.8 | 75.2 | 92.5 |
| SAM 3 Generated (Ours) | YOLOv8n | 3.2 | 5.70 | 10.13 | 76.7 | 93.3 | 86.4 | 27.8 | 78.1 |
| SAM 3 Generated (Ours) | YOLOv8s | 11.2 | 6.10 | 10.37 | 78.7 | 93.5 | 87.7 | 32.1 | 80.1 |
| SAM 3 Generated (Ours) | YOLOv8m | 25.9 | 14.70 | 16.71 | 79.4 | 93.6 | 88.2 | 30.6 | 80.8 |
| Zero-shot Baseline | SAM 3 | ~850 | 1197.18 | 1242.53 | 80.7 | 93.6 | 88.4 | 26.9 | 82.4 |
Key takeaway: Models trained on SAM 3 pseudo-labels retain up to 98.4% of SAM 3's zero-shot detection performance (79.4 vs 80.7 mAP, and identical 93.6% AP₅₀) while reducing latency from ~1,242 ms to 10–16 ms (over 70× – 120× speedup).
If you use these models or pseudo-labels in your research, please cite our paper:
@misc{faria2026sam3assistedtraininglightweightyolo,
title={SAM3-Assisted Training of Lightweight YOLO Models for Precision Pig Farming},
author={Marcos Vinicius Mendes Faria and Thiago Borges Pereira and Isabella C. F. S. Condotta and Thiago Meireles Paixão and Francisco de Assis Boldt},
year={2026},
eprint={2605.25860},
archivePrefix={arXiv},
primaryClass={cs.CV},
url={https://arxiv.org/abs/2605.25860},
}