Abstract
The pork industry is an essential part of the global food system, providing a significant source of protein for people around the world. A major factor restraining productivity and compromising animal wellbeing in the pork industry is disease outbreaks in pigs throughout the production process: widespread outbreaks can lead to losses as high as 10% of the U.S. pig population in extreme years. In this study, we present a machine learning model to predict the emergence of infection in swine production systems throughout the production process on a daily basis, a potential precursor to outbreaks whose detection is vital for disease prevention and mitigation. We determine features that provide the most value in predicting infection, which include nearby farm density, historical test rates, piglet inventory, feed consumption during the gestation period, and wind speed and direction. We utilize these features to produce a generalizable machine learning model, evaluate the model's ability to predict outbreaks both seven and 30 days in advance, allowing for early warning of disease infection, and evaluate our model on two swine production systems and analyze the effects of data availability and data granularity in the context of our two swine systems with different volumes of data. Our results demonstrate good ability to predict infection in both systems with a balanced accuracy of 85.3% on any disease in the first system and balanced accuracies of 74.8%, 58.0%, 72.8% and 58.0% on porcine reproductive and respiratory syndrome, porcine epidemic diarrhea virus, influenza A virus, and Mycoplasma hyopneumoniae in the second system, respectively, using the six most important predictors in all cases. These models provide daily infection probabilities that can be used by veterinarians and other stakeholders as a benchmark to more timely support preventive and control strategies on farms.
Introduction
The global pork industry faces significant threats from infectious diseases like Porcine Reproductive and Respiratory Syndrome (PRRS) and Porcine Epidemic Diarrhea Virus (PEDV). Modern swine production has shifted toward specialized, multi-site operations, which necessitates frequent animal movements and creates "contact networks" that facilitate rapid disease spread. Current disease control relies on labor-intensive biosecurity and reactive testing. This research addresses the critical gap in forecasting tools by determining if machine learning can transform routine production and environmental data into a reliable early-warning system.
Methods and Data
The study compared two distinct swine production systems: System A (sparse data, 60 farms) and System B (rich data, 148 farms). Infection prediction was treated as a binary classification problem. The authors evaluated ensemble models (Random Forests, Gradient Boosting) and an Auto-encoder Multi-Layer Perceptron (MLP) to handle distribution shifts. Features were derived from a 60-day historical window and included diagnostic data, movement logs, production KPIs (e.g., piglet inventory, gestation feed), biosecurity protocols, and weather data.
Key Insights and Feature Importance
Feature importance analysis revealed that spatial density—specifically the distance to neighboring farms—is a primary risk factor, acting as a proxy for local area spread. Additionally, production metrics like gestation feed consumption and piglet inventory act as "biological sensors," providing leading indicators of herd stress before clinical symptoms or positive lab tests emerge. Environmental factors, including wind speed and direction, also played a significant role in predicting infection risk.
Results and Discussion
The framework achieved a balanced accuracy of 85.3% for "any disease" in System A. In System B, disease-specific accuracies reached 74.8% for Mycoplasma hyopneumoniae (MHP) and 72.8% for Influenza A (IAV). The models maintained high accuracy even with a 30-day lead time, offering a significant window for preventive action. While challenges like distribution shift and data granularity remain, integrating these models into real-time platforms like the Disease BioPortal represents a major step toward proactive disease management in the swine industry.
Summary updated