Lung inspection at slaughter can provide valuable insights into respiratory disease prevalence and severity, while also offering important feedback regarding effectiveness of on-farm control strategies. However, the cost-effectiveness of human inspection may be limited. The implementation of automated computer vision systems (CVS) could allow continuous and standardised data collection. This study aimed to investigate the feasibility of a deep learningbased model to simultaneously identify and segment anatomical structures, lesions and slaughtering artefacts in pig lungs. The lungs from 871 heavy pig finishers were collected at slaughter and subjected to macroscopic examination and lateral-view image acquisition. All the 1,742 images were manually annotated with polygons outlining anatomical (lung, heart, lung lobes), pathological (bronchopneumonia, fibrinous pleuropneumonia, pleuritis), and artefactual (parenchymal laceration, bronchoinhalation of blood) findings. The dataset was split into 70% for model training and 30% for its validation, using a derivative of YOLO version 8 for instance segmentation. Model outputs included: segmentation masks localising the predicted findings, class labels for each predicted instance, and a confidence score (ranging from 0 to 100%) indicating the likelihood of correct classification. Model performance was evaluated in terms of sensitivity (Se), positive predictive value (PPV) and F1 score (harmonic mean of Se and PPV) by comparing model predictions on test set images with ground truth annotations. The model performance varied depending on the selected confidence threshold, with average Se (36-84%), PPV (62-93%), and F1 score (52-78%) indicating imperfect but improvable performance. The model showed high Se and PPV for the heart, lung and lung lobe segmentation. As expected, segmentation of pathological and artefactual findings showed lower performance. This discrepancy may be due to a combination of a relevant class imbalance within the training dataset, particularly the under-representation of pathological classes, and the inherent complexity of lung pathology. Future research should increase and rebalance the sample size while assessing model performance in real-world abattoir settings, comparing outputs with routine post-mortem veterinary examinations. Validated CVS tools would be crucial in optimizing control and prevention of respiratory diseases, advancing pig health and welfare while reducing antimicrobial use.
Deep learning-based detection of macroscopic pig lung lesions / M. Recchia, L. Scuri, C. Allegri, C. Romeo, F.S. Federica Guadagno, A. Marco Maisano, G. Santucci, G. Bontempi, S. Canesi, L. Sala, C. Recordati, E. Scanziani, S. Panseri, S. Ghidini, E. Zanardi, A. Ianieri, L. Alban, G. Loris Alborali. ((Intervento presentato al 15. convegno International Symposium on the Epidemiology and Control of Biological, Chemical and Physical Hazards in Pigs and Pork : 6 - 8 October tenutosi a Rennes nel 2025.
Deep learning-based detection of macroscopic pig lung lesions
S. Canesi;L. Sala;C. Recordati;E. Scanziani;S. Panseri;S. Ghidini;
2025
Abstract
Lung inspection at slaughter can provide valuable insights into respiratory disease prevalence and severity, while also offering important feedback regarding effectiveness of on-farm control strategies. However, the cost-effectiveness of human inspection may be limited. The implementation of automated computer vision systems (CVS) could allow continuous and standardised data collection. This study aimed to investigate the feasibility of a deep learningbased model to simultaneously identify and segment anatomical structures, lesions and slaughtering artefacts in pig lungs. The lungs from 871 heavy pig finishers were collected at slaughter and subjected to macroscopic examination and lateral-view image acquisition. All the 1,742 images were manually annotated with polygons outlining anatomical (lung, heart, lung lobes), pathological (bronchopneumonia, fibrinous pleuropneumonia, pleuritis), and artefactual (parenchymal laceration, bronchoinhalation of blood) findings. The dataset was split into 70% for model training and 30% for its validation, using a derivative of YOLO version 8 for instance segmentation. Model outputs included: segmentation masks localising the predicted findings, class labels for each predicted instance, and a confidence score (ranging from 0 to 100%) indicating the likelihood of correct classification. Model performance was evaluated in terms of sensitivity (Se), positive predictive value (PPV) and F1 score (harmonic mean of Se and PPV) by comparing model predictions on test set images with ground truth annotations. The model performance varied depending on the selected confidence threshold, with average Se (36-84%), PPV (62-93%), and F1 score (52-78%) indicating imperfect but improvable performance. The model showed high Se and PPV for the heart, lung and lung lobe segmentation. As expected, segmentation of pathological and artefactual findings showed lower performance. This discrepancy may be due to a combination of a relevant class imbalance within the training dataset, particularly the under-representation of pathological classes, and the inherent complexity of lung pathology. Future research should increase and rebalance the sample size while assessing model performance in real-world abattoir settings, comparing outputs with routine post-mortem veterinary examinations. Validated CVS tools would be crucial in optimizing control and prevention of respiratory diseases, advancing pig health and welfare while reducing antimicrobial use.| File | Dimensione | Formato | |
|---|---|---|---|
|
Proceedings_safepork+R(1).pdf
accesso aperto
Tipologia:
Publisher's version/PDF
Licenza:
Creative commons
Dimensione
1.06 MB
Formato
Adobe PDF
|
1.06 MB | Adobe PDF | Visualizza/Apri |
Pubblicazioni consigliate
I documenti in IRIS sono protetti da copyright e tutti i diritti sono riservati, salvo diversa indicazione.




