February 23, 2025 | 16:33 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)

Japan contributes $11.9 million to scale up FAO’s emergency and resilience activities

Japan contributes $11.9 million to scale up FAO’s emergency and resilience activities

(VAN) The funding will support 14 critical projects across Africa, Asia, Europe, and the Middle East.

US paper industry asks Trump to seek lighter EU deforestation rules

US paper industry asks Trump to seek lighter EU deforestation rules

(VAN) Brussels already delayed the policy's launch by a year following complaints from trade partners including Brazil, Indonesia and the Biden administration in the United States.

Bird flu has been spreading undetected in cows and vets

Bird flu has been spreading undetected in cows and vets

(VAN) Avian influenza (H5N1) has been spreading in the United States among dairy cows since last year.

A vet’s view – 6 areas of risk when dealing with avian influenza

A vet’s view – 6 areas of risk when dealing with avian influenza

(VAN) The government has declared an all-England, Wales and Scotland avian influenza prevention zone (AIPZ) along with regional housing measures to protect the national flock as cases increase across Great Britain.

FAO ensures transparency and quality in measuring SDG 2 (Zero Hunger) Indicators

FAO ensures transparency and quality in measuring SDG 2 (Zero Hunger) Indicators

(VAN) Statement of the Food and Agriculture Organization of the United Nations.

Thailand expects fruit exports to reach 8.5 billion USD

Thailand expects fruit exports to reach 8.5 billion USD

(VAN) The Thai Ministry of Commerce recently held a signing ceremony for memorandums of understanding (MoUs) between Thai exporters and international buyers to boost fruit export value.

Bayer backs broadened effort to shield popular weedkiller from claims it failed to warn of cancer

Bayer backs broadened effort to shield popular weedkiller from claims it failed to warn of cancer

(VAN) A broader media campaign is highlighting the importance of glyphosate-based Roundup for American agriculture.

Read more