Improved cattle farm classification: leveraging machine learning and linked national datasets - Schnidrig, Guy-Alain; Struchen, Rahel; Schärrer, Sara; Heim, Dagmar; Hadorn, Daniela; Schüpbach-Regula, Gertraud; Paternoster, Giulia (Frontiers in Veterinary Science, 2025)
While many countries have registries of livestock farms, it can be challenging to obtain information on their primary production type. For example, for Swiss farms registered as keeping cattle, a distinction can only be made between milk-producing and non-milk-producing farms. The Swiss cattle industry consists of beef and dairy farms, with a strong predominance of small to medium-sized farms. A better differentiation of cattle production types would be beneficial for the planning and evaluation of surveillance programmes for cattle diseases and for the benchmarking antibiotic consumption. The aim of this study was to outline cattle production types of interest and to allow the classification of Swiss cattle farms according to production type in order to optimize surveillance. We collaborated with experts to define the five primary cattle production types: calf fattening, dairy cattle, cattle fattening, rearing cattle and suckler cows. In collaboration with the cantonal Veterinary Offices, we collected production types from 618 reference farms across 14 cantons and defined a total of 24 features by combining information from three national databases. Using farm-level data on milk production, age and sex distribution, cattle breeds, calving, births, slaughter, animal movements and antibiotic use, we trained three different machine learning models capable of classifying the five production types. Among these models, the Random Forest model demonstrated the highest level of performance, achieving an accuracy of 0.914 (95% CI: 0.890, 0.938) and an F1-Score of 0.879 (95% CI: 0.841, 0.913). In conclusion, together with experts, we have outlined five primary production types on cattle farms in Switzerland and developed a model that allows a reproducible, year-to-year classification of cattle farms using national datasets. Our flexible methodology could be adapted to other countries and datasets, enabling veterinary authorities to conduct more efficient and targeted disease surveillance in the future.