IDEAS home Printed from https://ideas.repec.org/a/gam/jagris/v15y2025i7p696-d1620259.html
   My bibliography  Save this article

Swift Transfer of Lactating Piglet Detection Model Using Semi-Automatic Annotation Under an Unfamiliar Pig Farming Environment

Author

Listed:
  • Qi’an Ding

    (College of Intelligent Manufacturing, Anhui Science and Technology University, Chuzhou 233100, China
    College of Engineering, Nanjing Agricultural University, Nanjing 210031, China)

  • Fang Zheng

    (Key Laboratory of Smart Farming Technology for Agricultural Animals, Ministry of Agriculture and Rural Affairs, Wuhan 430070, China)

  • Luo Liu

    (College of Veterinary Medicine, Nanjing Agricultural University, Nanjing 210014, China)

  • Peng Li

    (College of Engineering, Nanjing Agricultural University, Nanjing 210031, China)

  • Mingxia Shen

    (College of Artificial Intelligence, Nanjing Agricultural University, Nanjing 210031, China)

Abstract

Manual annotation of piglet imagery across varied farming environments is labor-intensive. To address this, we propose a semi-automatic approach within an active learning framework that integrates a pre-annotation model for piglet detection. We further examine how data sample composition influences pre-annotation efficiency to enhance the deployment of lactating piglet detection models. Our study utilizes original samples from pig farms in Jingjiang, Suqian, and Sheyang, along with new data from the Yinguang pig farm in Danyang. Using the YOLOv5 framework, we constructed both single and mixed training sets of piglet images, evaluated their performance, and selected the optimal pre-annotation model. This model generated bounding box coordinates on processed new samples, which were subsequently manually refined to train the final model. Results indicate that expanding the dataset and diversifying pigpen scenes significantly improve pre-annotation performance. The best model achieved a test precision of 0.921 on new samples, and after manual calibration, the final model exhibited a training precision of 0.968, a recall of 0.952, and an average precision of 0.979 at the IoU threshold of 0.5. The model demonstrated robust detection under various lighting conditions, with bounding boxes closely conforming to piglet contours, thereby substantially reducing manual labor. This approach is cost-effective for piglet segmentation tasks and offers strong support for advancing smart agricultural technologies.

Suggested Citation

  • Qi’an Ding & Fang Zheng & Luo Liu & Peng Li & Mingxia Shen, 2025. "Swift Transfer of Lactating Piglet Detection Model Using Semi-Automatic Annotation Under an Unfamiliar Pig Farming Environment," Agriculture, MDPI, vol. 15(7), pages 1-20, March.
  • Handle: RePEc:gam:jagris:v:15:y:2025:i:7:p:696-:d:1620259
    as

    Download full text from publisher

    File URL: https://www.mdpi.com/2077-0472/15/7/696/pdf
    Download Restriction: no

    File URL: https://www.mdpi.com/2077-0472/15/7/696/
    Download Restriction: no
    ---><---

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:gam:jagris:v:15:y:2025:i:7:p:696-:d:1620259. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    We have no bibliographic references for this item. You can help adding them by using this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: MDPI Indexing Manager (email available below). General contact details of provider: https://www.mdpi.com .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.