New machine learning model for cuts of pork 

When a male pig is CT-scanned at Topigs Norsvin’s test stations, the images are immediately uploaded to the cloud. A newly updated machine learning model is being used for cuts of pork that results in improved genetic progress. 

By: Øyvind Nordbø, Scientist

The new machine learning model is an important tool for improving genetic programs regarding slaughter percentage and especially valuable cuts of pork, and for sorting pigs for different markets. 

In 2008, Norsvin bought a CT scanner to perform measurements of meat and slaughter percentages directly on male pigs at the test station. Initially, the analysis of CT images was largely conducted manually by drawing on the images where the cross-section between the intestines and the breast/abdominal cavity should go. In addition, we conducted an automated analysis of the slaughter using the gray scale on CT images (see Figure 1a) to find out how much of the slaughter was bone, fat and muscle. This was a big improvement compared to the half-sibling test.  

Text continues after the photo.

An image containing a circle

Automatically generated description

Figure 1: Images from CT, a) without segmentation, b) segmented with previous machine learning model, c) with manually corrected segmentations, used to train new machine learning model. Pink is loin, blue is intestines, green is belly, while turquoise is ham/leg. In c) we have also added an extra category for the cradle (in orange). 

Automated analysis and Artificial Intelligence  

In 2016, a more automated ‘atlas’ method for analyzing CT images was developed. In addition to automatically making the cross-section between the intestines and the abdominal cavity in 3D, this model could also divide the CT image into the ham/leg, shoulder, head, belly and loin cuts. This was a big step towards full automation, but the weakness was that the model required a lot of power to run. A powerful computer took half an hour per animal to calculate the cuts of pork.  

Artificial intelligence techniques have developed rapidly since 2015, and we saw relatively quickly that these methods were easier to run routinely than their predecessors. These methods can be run completely automatically, but they require a large dataset of annotated data. By annotated data, we mean a summary of what we want the machine learning model to perform.  

In our case, we already had a good dataset of segmentations (see fact box) from the ‘atlas’ model that we used to train the model. 

FACTBOX  
What is segmentation?  

Segmentation is a method of being able to find out which pixels in an image belong to different categories.
In the latest machine learning model for cuts of pork, we have nine different categories: background, cradle, intestines, head, loin, belly, shoulder, ham/leg and testicles. 

In 2020, the first machine learning model for cuts of pork was put into operation. This model processed all CT-scanned pigs for almost three years. The model also included data from CT-scanned pigs at Delta Canada, which had opened two years earlier

New model 

In 2022, we started work to retrain the machine learning model. We had discovered that the earlier version had some weaknesses that we wanted to improve. In particular, this applied to segmentation of testicles and intestines, and in some cases, we also noticed that the cradle in which the pig lies during the CT scan was included as part of the pig (see Figure 1b).  

However, manual segmentation is monotonous and tedious work. Instead of segmenting everything from scratch, we wanted to use the segmentations that the old model produced, and correct them instead.

The head, loins, shoulder and ham/leg were relatively well segmented, while we manually drew new outlines of testicles, cradle and intestines into a drawing program on the computer (see Figure 1c).

This information was then used to retrain the model. We did this in an iterative process called active learning. We predicted segmentations on some new animals, quality checked them manually, corrected those that weren’t good enough, and retrained the model with an increasingly larger dataset. Finally, we had a model of satisfactory quality. We have now used this model to process all 60,000 animals that have been scanned from 2011 to the present day. 

FACTBOX 
What is machine learning?
 
Machine learning is a collective term for different methods that one uses to make predictions. Typically, one would give a computer sample data and a solution-interpretation of the data. 
In addition, one must have a model with trainable parameters that can learn the pattern between data and solution. You then train the model on the sample data and end up with a prediction model

  Quality goals 

The quality of a machine learning model can be calculated in many ways. For our segmentation model, one can calculate the percentage of pixels that are classified correctly in relation to a solution. We also have some pigs that were butchered in previous trials, and one can look at how well the prediction matches the actual cuts of pork that have been weighed.  

We can also run a genetic analysis of the characteristics and see how heritable they are. If the characteristics have a higher degree of heritability (the percentage of the characteristic that can be explained by genes), a smaller part of the characteristics are related to noise, and the precision of the machine learning model is improved.  We see that heritability increases considerably for shoulder, belly and ham/leg. For the slaughter percentage, the level is the same, while heritability is somewhat lower for the percentage of loin compared to the previous machine learning model. 

A more powerful tool 

The new machine learning model is a more powerful tool in genetic programs for pigs, but the previous version wasn’t bad either. In addition to improving the model in relation to cuts of pork, the work has also provided us with knowledge on how to effectively manage the development of a machine learning model. This experience will take us into further work on developing automated models for skeletal, cardiac and pulmonary health in pigs. 


New test and innovation center Delta Norway 

A new high-tech test and innovation center will open this year in Norway. Delta Norway has an annual test capacity of 5,000 young boars from the Norsvin Landrace and TN Duroc lines.  

New technical solutions and infrastructure for large-scale data capture will significantly boost our genetic program. Besides individual feed intake registration and performance measurements, the extensive use of sensors, cameras, and artificial intelligence will make it possible to track pigs continuously and register fluctuations in their environment and behavior.  

The construction of Delta Norway will be completed in June 2024. The plan is to receive the first animals in July 2024.  

Share this post: