June 21, 2025 | 03:00 GMT +7

  • Click to copy
Tuesday- 09:02, 10/10/2023

Machine learning uses feeding data to detect illness in pigs

(VAN) Researchers from Finland used machine learning methods applied on feeding behaviour data to detect pigs that may be ill.
Photo: Herbert Wiiggerman

Photo: Herbert Wiiggerman

That became clear in a recent publication by researchers from the University of Helsinki and Finland’s Natural Resources Institute, which was shared in the peer-reviewed journal Biosystems Enginering.

In pig production systems, alteration in feeding behaviour can be used as an early sign of discomfort and illness. However, in a commercial farm, there is a limited time to observe and detect the individual behavioural changes to avoid delayed treatment of sick animals, economic losses, and impaired welfare. Automatic data collection using sensors and feeders provides valuable information regarding early signs of disease.

Data collection

The team collected the feeding behaviour data of 10,261 pigs (Finnish Yorkshire, Finnish Landrace, and F1-crossbred) from the central test station in Finland from 2011 to 2016. They grouped the pigs into different pens according to their arrival age, weight, and sex. Pigs were provided with water and feed ad libitum.

The researchers recorded the number of visits per day, time spent feeding per day, and daily feed intake. The illness data included symptoms such as coughing, a limp, loss of appetite, skin damage, and a bitten tail. In the machine learning models, pigs with any of the recorded symptoms were classified as “ill” for that given day. Pigs with no recorded symptoms were classified as “healthy”.

New features

The absolute values of time spent feeding per day and daily feed intake were not optimal features for predicting the illness status of pigs due to their strong relationship to the animal’s age. Therefore, the team created new features including daily ranks and residuals. Daily ranks related the rank of an animal’s observation compared to other pigs within a pen in each day. Residuals described the animals’ difference from the expected value for a pig of same age. Then, the team predicted the health status of a pig based on features including the original feeding behaviour traits and features derived using a machine learning algorithm.

They based their predictions either on the features from the same day (one-day window), from the same day and 2 previous days (3-day window), or from the same day and 6 previous days (7-day window).

Performance of the models

The researchers obtained the best performance with the model applied in the 7-day window with 67% sensitivity and 73% specificity. However, the precision was quite low. This may be due to overlooking mild symptoms by station staff during the daily routine check. In addition, low precision could be due to a highly imbalanced dataset causing biased classification in machine learning.

Behavioural changes in pigs may indicate illness. However, these changes may be rapid and indicate illness immediately or the changes may begin several days prior to illness. In this study therefore, models with various window lengths were applied to find the optimal data recording length based on the features and nature of the data. Hyperparameters are optimisation parameters that tune the performance of machine learning algorithms. The best hyperparameters were obtained based on data that was provided during training and used in prediction of the models. The sensitivity and specificity of the models were acceptable with all window lengths. In addition, increasing the window length enhanced the performance of the classification models.

The features of the model

Using features that indicate a difference in a pig’s an feeding behaviour from its pen mates (rank) or from pigs of the same age (residual) was more beneficial in predicting pig sickness than absolute values. Therefore, a deviation from a typical daily feeding time or daily feed intake compared to the feeding time and daily feed intake of an average pig at the same age is a good indication of a possible health problem. In addition, using the 7-day window model with only the best 10 important features instead of all 40 features increased model performance slightly and reduced the model’s run time.

Conclusions

The authors concluded that “pig illness is detectable by applying a machine learning algorithm to the feeding behaviour data; however, the results can be improved by calculating new features, considering interactions between features, using different window length(s), and different methods.

HD

(PP)

New outbreaks of Newcastle disease wreak havoc on Poland’s poultry industry

New outbreaks of Newcastle disease wreak havoc on Poland’s poultry industry

(VAN) Poultry production in Poland, which has only started recovering from devastating bird flu outbreaks earlier this year, has been hit by a series of outbreaks of Newcastle disease, with the veterinary situation deteriorating rapidly.

China demands sensitive information for rare earth exports, companies warn

China demands sensitive information for rare earth exports, companies warn

(VAN) Extensive licensing requirements raise concerns about intellectual property theft.

Salmonella outbreak linked to California egg distributor sickens 79 people

Salmonella outbreak linked to California egg distributor sickens 79 people

(VAN) As of Friday, a salmonella outbreak linked to a California egg producer had sickened at least 79 people. Of the infected people, 21 hospitalizations were reported, U.S. health officials said.

Ukraine: Rural communities need immediate support to plant and produce food amid ongoing war

Ukraine: Rural communities need immediate support to plant and produce food amid ongoing war

(VAN) With the war ongoing, many Ukrainian farmers and rural farming families face limited access to their land due to mines and lack the financial resources to purchase needed agricultural inputs.

How the fertiliser king of WA grew a $5b fortune with no one noticing

How the fertiliser king of WA grew a $5b fortune with no one noticing

(VAN) Vikas Rambal has quietly built a $5 billion business empire in manufacturing, property and solar, and catapulted onto the Rich List.

Gaza’s agricultural infrastructure continues to deteriorate at alarming rate

Gaza’s agricultural infrastructure continues to deteriorate at alarming rate

(VAN) Available cropland now at less than five percent, according to latest geospatial assessment from FAO and UNOSAT.

Alt Carbon scores $12M seed to scale carbon removal in India

Alt Carbon scores $12M seed to scale carbon removal in India

(VAN) Alt Carbon has raised $12 million in a seed round as it plans to scale its carbon dioxide removal work in the South Asian nation.

Read more