Skip to main content
Have a personal or library account? Click to login
Application of Artificial Intelligence (AI) in Modern Pig Breeding Cover

Full Article

Modern pig farming faces a number of challenges, such as growing demand for animal products, the need to improve economic efficiency, ensure animal welfare and minimize negative environmental impacts. It is estimated that by 2050 global demand for food will increase by 70% and for meat by more than 50% (Bonny et al., 2017).

This means that the livestock sector must not only meet production requirements, but also implement sustainable strategies, ensuring a balance between production efficiency, animal welfare and environmental protection. There is an increasing emphasis on production quality and animal welfare, which includes natural behavior, subjective feelings, and health and proper body function (Fraser et al., 1997; Ohl and Van der Staay, 2012). Inadequate housing conditions can negatively impact production results, ultimately reducing farm profitability.

In response to these challenges, artificial intelligence (AI) technologies are being developed and are playing a key role in modernizing livestock production. AI has become a tool to support decision-making processes, enabling analysis and processing of large data sets in real time. AI algorithms enable the monitoring of animal health, prediction of nutritional needs, early detection of disease symptoms and optimization of environmental conditions (Vranken and Berckmans, 2017). The implementation of these solutions is becoming essential, especially in large-scale farms where traditional monitoring methods are insufficient (Collins and Smith, 2022).

Powered by information technology, pig farming is undergoing a dynamic transformation. A combination of state-of-the-art systems, such as video monitoring, sound analysis and intelligent feeding systems, are making herd management easier and more efficient (Figure 1).

Figure 1.

Implementation of AI technology in pig farming (Wang et al., 2022).

AI is an interdisciplinary field of science that aims to create systems capable of performing tasks that require intelligence, such as data analysis, decision-making and natural language processing. It is based on algorithms and mathematical models that process large data sets to recognize patterns and generate predictions (OECD, 2023; Russell and Norvig, 2021). Figure 2 shows the methods that make up artificial intelligence (Peruffo et al., 2020).

Figure 2.

Operation of artificial intelligence (Peruffo et al., 2020).

The purpose of this paper is to review the applications of AI in pig production with a particular focus on its impact on animal welfare and breeding efficiency.

Reproduction

Reproduction in pig farming is a key component of herd management, affecting production, profitability and animal welfare. Effective reproduction management makes it possible to increase the number of pig-lets per sow per year, as well as to optimize costs associated with keeping sows. In addition, informed genetic selection increases the breeding and production value of animals, which translates into increased economic efficiency of breeding. Regular control and supervision of reproduction reduces the risk of health problems related to gestation and parturition (Knox, 2014).

Estrus detection in sows

The precise timing of estrus is crucial for successful insemination and increased fertility rates (Kemp et al., 2005). Traditional detection methods, based on observation of physiological signs (e.g., vulvar redness) and behavioral signs (e.g., back pressure test as a method to check for a pig’s standing reflex), often have low precision, leading to misinterpretations and reduced insemination efficiency (Steverink et al., 1999; Riaz et al., 2023). Due to the individual variability of estrous symptoms and large herds on large-scale farms, it is necessary to implement automated detection systems using activity sensors, sound analysis and AI algorithms. Due to the growing threat of African swine fever (ASF) and the need to reduce direct contact between animals, alternative methods of detecting estrus that do not require the presence of a boar are being sought. Sensor-based systems offer a promising solution, allowing 24-hour monitoring of estrous symptoms before visual signs are present (Freson et al., 1998). Developments in AI, image analysis and audio technologies are opening up new opportunities in heat monitoring and pig management. The integration of these systems with IoT technologies and BD analytics may in the future allow even more precise forecasting of the estrous cycle, improving both animal welfare and the economic efficiency of pig production.

The use of sensors and accelerometers placed on sows’ necks or other locations on their bodies allows precise monitoring of physical activity, which is important in detecting estrus. Cornou (2006) showed that sow physical activity increases significantly on the day before estrus, making activity measurements an effective method of detecting it. Similarly, Altmann (1941), using a pedometer, noted that sows show twice as much physical activity during the period of estrus compared to inter-estrous intervals. A study by Bressers et al. (1993) demonstrated that the use of accelerometers can detect significant differences in activity levels – sows in heat generated ten times more movements exceeding the 10 m/s2 threshold than sows not showing estrous symptoms. Geers et al. (1995) confirmed these results, also finding a tenfold increase in activity during the estrous period. Ostersen et al. (2010) used a RFID system in conjunction with gates equipped with sensors, analyzing the frequency and length of sows’ visits to the boar. The method was able to detect estrus in 87.4% of sows, with high specificity (99.4%) for a specific day of the cycle. However, despite the high precision, the classification error was 9.1%, indicating the limitations of this technology, especially when used as the only method of estrus detection.

Integrating sensors with IoT systems enables remote tracking of sow activity and real-time breeding decisions, greatly increasing the precision of insemination management. The data can be sent to central databases, where AI analyzes behavioral patterns and determines the optimal moment for mating, resulting in increased fertilization success. Despite the numerous advantages of sensor technologies, their widespread use on commercial pig farms comes with some challenges. Among the most commonly reported problems are the need to calibrate the devices, energy consumption, and the impact of environmental conditions, such as temperature, humidity, or contamination levels, on the accuracy of measurements. Additionally, individual differences in animal behavior can lead to misinterpretations of results. Improper mounting of sensors or their insufficient stability are also important limitations that can affect the reliability of the collected data. Figure 3 shows an example of sensor application.

Figure 3.

Location of sensors for data acquisition (author: K. Kropiwiec-Domańska).

Sensors installed in the livestock environment, video cameras and sound analysis systems enable comprehensive monitoring of sow behavior, and the collected data is then processed by ML algorithms to automatically detect characteristic estrous patterns. Studies indicate that image analysis can be an effective tool in heat detection. Zhuang et al. (2020) analyzed images of sows’ ears using the AlexNet neural network and showed that the duration of erect ears in the presence of a male can be a significant indicator of estrus, achieving a sensitivity of 79.16%. Nasirahmadi et al. (2016) on the other hand, applied image processing techniques to automatically locate pigs in images and developed an algorithm that identifies estrous events with an accuracy of 92.7%. These results confirm that machine vision techniques can effectively support reproduction management systems in commercial farms. Li et al. (2020) proposed a three-dimensional (3D) model for recognizing sow estrous behavior based on a neural network for analyzing pig movement sequences, achieving an accuracy of 97.63%. In addition to methods based on motion analysis, the influence of hormonal changes on animal behavior is also important. In a study by Lee et al. (2019 a), it was shown that an increase in estrogen levels during estrus causes an increase in cortisol, which can be an additional indicator for automatic estrus detection systems. In a study by Verhoeven et al. (2023), an AI-based SmaRt Sow Breeding (SSB) system was tested. The system was implemented on three sow farms in Belgium, where 6717 reproductive cycles were analyzed. The system enabled automatic heat detection based on behavioral changes in sows, improving the accuracy of heat symptom assessment, reducing the number of inseminations per cycle and increasing reproductive efficiency. Field experiments showed that the SSB system allowed the detection of heat symptoms 10 to 20 hours earlier than conventional methods. Although the data used by ML models comes from a variety of sensors, algorithm processing is key.

In addition to image analysis, sound analysis plays an important role in estrus detection. Wang et al. (2022) developed a method for estrus detection based on acoustic data analysis using a convolutional neural network (CNN). The improved MobileNetV3_esnet model achieved an accuracy of 97.52%. The method can effectively detect both strong and weak signs of estrus, making it an effective tool for automatic monitoring of the estrous cycle. Further development of computer vision-based methods was presented by Xue et al. (2022), who developed an estrus detection system based on neural networks and the YOLOv5s model with the CBAM module. The system analyzed four basic postures of sows (standing, sitting, sternal and lateral recumbency) and the frequency of their changes, which allowed precise determination of the phase of estrus. Its implementation could eliminate the need for manual observation and replace traditional methods such as the back pressure test (BPT). An innovative method was proposed by Xu et al. (2023), who developed a system based on light detection and ranging (LiDAR) cameras that allows non-contact and objective evaluation of vulvar swelling changes. The average measurement error was 3.4 ± 3.0 mm, and vulvar volume was a strong indicator of estrus (R2 = 0.92). Early and accurate detection of estrus in this model can reduce the number of unproductive days and increase pig rearing and breeding efficiency. Lei et al. (2021) introduced a novel method for intelligent heat monitoring using bionic boars and machine vision. The system enabled identification of estrus based on increased contact time between sows and the bionic boar (29.7 s/3 min) and static behavior of the ears (41.3 s/3 min). Deep Belief Networks (DBN), Sparse Auto Encoder (SAE) and Support Vector Machine (SVM) models were used to classify estrus, achieving accuracies of 96.12%, 98.25% and 90.00%, respectively. The method can accurately determine the optimal timing of insemination, supporting the efficiency of reproductive management.

Gestation, parturition and lactation

In recent years, the importance of farm animal welfare has been increasing due to the intensification of production, which can adversely affect their health. For pigs, as a keystone species in livestock production, welfare regulations are particularly stringent (Jang and Oh, 2022).

Early detection of gestation and prediction of litter size provides important information not only for optimizing farm management, but also for planning feeding, reproduction and environmental conditions of sows. Kousenidis et al. (2022) developed a numerical prediction model using real-time ultrasound (RTU) imaging and deep neural networks (DNN) to predict the number of piglets in a litter. The results of ultrasound analysis using ML showed high prediction accuracy, especially when the diagnosis was made on days 20–22 of gestation. The model can help improve reproductive management, reduce breeding losses and optimize production costs.

Once gestation is confirmed, a crucial period begins when monitoring the health of sows becomes important to minimize the risk of early fetal losses. Durand et al. (2023) used a combination of supervised and unsupervised learning methods to analyze sensor data to assess the welfare of gestating sows. Using data from automated feeders and video analysis, the authors achieved an accuracy of more than 72%. The results highlight the potential of automated decision support systems (DSS) in assessing the welfare of both individual animals and entire groups. The method enables effective modeling of behavioral and environmental patterns to identify key welfare indicators and implement preventive measures.

Another critical period in the sow’s reproductive cycle is the periparturient period, in which anticipation of parturition plays an important role in the management of the sow and her offspring, enabling appropriate interventions. Proper analysis of periparturient behaviors, e.g., frequency of assuming a recumbent position, allows the identification of sows that pose a potential risk to their piglets. The introduction of technologies to help assess these behaviors underscores the importance of adjusting breeding systems to minimize the risk of crushing piglets, which directly affects their survival and welfare (Špinka et al., 2000; Marchant et al., 2001).

Thompson et al. (2019) used accelerometric sensors to analyze the lying behavior of sows in both traditional restricted and unrestricted farrowing systems. In addition, the ability to predict parturition based on nest-building activity was evaluated. The use of multiple sensors placed on the sow’s body increased the accuracy of monitoring animal activity, and the analysis of postural changes made it possible to detect the start of nest building, which made it possible to predict parturition an average of 11.1 (±4.65) hours earlier. The results of the study underscore the importance of integrating monitoring technology with breeding systems, enabling accurate assessment of sow behavior.

After parturition, inadequate nutrient in-take of lactating sows can lead to serious reproductive consequences, especially in highly prolific sows (Martineau and Badouard, 2009).

A study by Rodríguez et al. (2023) identified five different patterns of feeding curves in lactating sows using ML methods. The analysis showed that feed intake patterns during lactation significantly affected sow fertility and piglet survival. Sows with high feed intake (HH) had the best reproductive performance, including a shorter period from weaning of piglets to the first estrus and a higher prolificacy rate (fewer stillborn piglets and mummified fetuses), while low intake (LL) was associated with a longer period from weaning to the onset of estrus and poorer production results. The use of automated feed intake monitoring systems enables early detection of unfavorable feeding patterns and implementation of interventions, which can improve breeding efficiency and increase piglet survival. These results indicate that integrating AI with sensor data, BD analysis, and producer information can provide effective tools to optimize sow reproduction management. This approach can help increase production efficiency, reduce costs, and limit the negative environmental impact of breeding.

Boar welfare and semen quality using AI

Modern technologies enable the real-time monitoring of boar health and welfare, facilitating the rapid identification and elimination of factors that can negatively impact semen quality. Optimization of nutrition, control of environmental conditions and reduction of stress play a key role in semen production (Radomil et al., 2011). The use of predictive models based on analysis of historical data and current conditions makes it possible to determine the most optimal time for semen collection, which significantly increases the efficiency of the insemination process. Under commercial conditions, boars are often exposed to stressors such as limited space, inadequate thermal conditions, limited access to feed and health problems, including lameness, which can negatively affect their reproductive ability. Of particular concern is the effect of heat stress on semen quality and reproductive efficiency. Studies by Hansen (2009) and He et al. (2020) have shown that elevated testicular temperature disrupts the process of steroidogenesis, leading to an increase in respiratory frequency and reduced sperm production. This results in decreased sperm motility and an increased percentage of morphologically abnormal sperm in the ejaculate. This has a significant impact on offspring development, so it is crucial to monitor boar health to ensure high-quality semen (Knox, 2016; Bortolozzo et al., 2024). Modern technologies, such as sensors, cameras, or accelerometers integrated with AI algorithms, make it possible to non-invasively monitor the condition of sires and predict their performance, which is important for the effectiveness of artificial insemination. For artificial insemination to be successful, it is crucial to obtain and process high-quality ejaculates. The most common method of semen selection is the evaluation of sperm kinetic parameters, sperm morphology and acro-some integrity (Broekhuijse et al., 2011). According to Tsakmakidis et al. (2010), the evaluated semen parameters (sensory evaluation and ejaculate volume) and spermatozoa parameters (morphology, motility, membrane integrity, DNA parameters, immunity) are related to the fertility results in the herd, e.g. conception rate or number of piglets born. Minimum criteria for semen doses used for artificial insemination: ejaculate volume >200 ml; sperm concentration >200 × 106 sperm/ml; total motility >70%; viability >75%; normal morphology >80% (Basioura et al., 2025). Semen is rejected if any of the above parameters are outside the established range. With the development of technology and the increasing amount of available data, advanced methods based on machine learning have been introduced.

Keller et al. (2025) used manually labeled images of sperm morphological defects and acrosome status and a convolutional neural network (CNN) to develop an integrated system for rapid semen quality assessment without the use of manual defect counting or biomarker labeling. A very high result of 99.8% was obtained in detecting changes in the state of acrosomes at 60× microscope magnification. Additionally, the model shows results of 96.73%, 98.55% and 99.31% for 20×, 40× and 60× magnifications, respectively, in classifying sperm morphological defects. The integration of BD and AI algorithms makes it possible to improve decision-making processes in the selection of ejaculates, which are then used in artificial insemination. An ideal ML algorithm should be able to analyze semen parameters and predict its potential for successful insemination. Moreover, initially trained based on sperm parameters, the model can be improved with additional data, including sow fertility, boar fertility and ejaculate characteristics (Broekhuijse et al., 2012; Fernández-López et al., 2022).

Future solutions in pig reproduction

Omics research, which includes the analysis of proteins, metabolites, transcripts and genes, has contributed to significant advances in reproductive science, which has broad applications in both humans and livestock, especially pigs. The use of “omics” technology to improve the reproductive performance of pigs is a promising research direction. Fu et al. (2020) were the first to create a comprehensive multiomics database for pigs, including almost all available publications on the genome, transcriptome, and genes and nucleotides associated with pig breeding traits. Based on these data, they developed an integration model based on ML and neural networks to prioritize candidate genes for specific traits and assess the biological significance of model parameters. Deep learning and ML techniques have already been used to predict reproductive traits based on multiomics data, including the course of gestation, female reproductive health and lactation performance. However, to date, there has been no research on their practical application in pigs, indicating the need for further work on implementing these methods into real breeding conditions. AI has become an integral part of everyday life, often operating in the background, unnoticed but effective. Its potential in animal breeding, especially in the area of pig reproduction, is enormous. AI can play a key role in improving reproductive processes, monitoring animal health and optimizing livestock management, opening up new prospects for the future of pig production.

Smart pig nutrition and body weight monitoring

Nutrition is one of the key environmental factors in pig breeding, affecting growth, development, health, reproduction and quality of animal products (Jamroz, 2022). It is also the most significant production cost, accounting for about 75% of total breeding expenses, making it a key element in optimizing breeding efficiency (Pawłowski et al., 2025). AI-based feeding systems use advanced algorithms to analyze data, such as growth rate, body weight and overall animal condition, enabling precise adjustment of feed quantity and composition to individual needs (Wang et al., 2023). This approach allows for the control of weight gain, animal health and the prevention of both overfeeding and nutritional deficiencies. Traditionally, all pigs at a given physiological stage receive a standardized diet, but according to the principles of precision breeding, taking into account individual differences between animals can significantly increase the efficiency of feeding systems. Thanks to smart feeders, advanced sensors and information technology, modern feeding systems allow diets to be better matched to the needs of individual animals, resulting in increased production efficiency (Cloutier et al., 2015).

Nutrition monitoring

Advances in pig breeding technology have made it possible to implement advanced systems for monitoring feeding behavior to optimize feed supply and better tailor it to individual animal needs. Modern methods include RFID, video and thermal imaging cameras, accelerometers, and microphones to analyze feed intake, intake volume, feeding time, and stress levels related to hunger and thirst. RFID technology is widely used on commercial farms to monitor feeding times, number of visits to the feeder, number of intervals between the visits, allowing for more efficient management of the feeding process compared to traditional methods (Finkenzeller, 2010; Maselyne et al., 2015; Racewicz et al., 2021). Each animal is characterized by its individual growth rate, feed requirements and nutrient use efficiency. Therefore, precision feeding systems using smart feeders, sensors and information technology help improve production efficiency, optimize feed consumption and reduce environmental impact (Cloutier et al., 2015; Pomar and Remus, 2023).

Estimating body weight

Monitoring pig weight is crucial from both a production and economic perspective, and regular recording of weight gains is an important indicator of health. Accurate weight gain data enables optimal decisions on marketing and slaughtering of fattening pigs, which is fundamental in smart pig production (Kashiha et al., 2014). As part of precision animal husbandry, automated image analysis systems are being developed that enable non-contact, real-time measurement of pig body weight. Kashiha et al. (2014) showed that the accuracy of pig weight estimation by image analysis was 97.5% (±0.82 kg). Additionally, the use of MLT (machine learning technology) enables more accurate predictions of growth indicators, such as daily weight gain and feed intake. In a study by Lee et al. (2019 b), environmental factors such as temperature, humidity, initial pig weight, and stocking density were considered by analyzing data collected from 55 pigs in South Korea over a year. The results showed that the use of MLT increased the accuracy of pig growth predictions by 28%, and temperature was the most significant factor affecting weight gain. The researchers concluded that MLT was more effective than image analysis, offering a better tool for monitoring animal growth. Wang et al. (2024) concluded that non-contact pig weight monitoring systems based on vision technologies and cloud data are an effective alternative to traditional weighing, minimizing animal stress and improving the efficiency of livestock management. Modern systems based on 3D images and point clouds allow more accurate weight prediction, although they still need to be improved and better adapted to farming conditions. Future research should focus on improving the accuracy of the algorithms, increasing automation, and lowering implementation costs.

Animal welfare

Animal welfare is a key aspect of modern livestock farming, and its importance is increasingly discussed in the context of ethics, health and production efficiency (Jirkof et al., 2019; Schindler and Steinhage, 2021). With the intensification of livestock breeding, new challenges arise in ensuring adequate living, health and environmental conditions, which directly affect the quality and efficiency of livestock production.

Modern technologies, including AI, play an important role in monitoring animal health and welfare, enabling automatic detection of diseases, lameness, and analysis of behavior and climatic conditions in pig houses. The integration of AI systems in breeding management enhances production efficiency, reduces disease risk, and supports informed breeding decisions, making the process more sustainable and resilient to health threats (Yin et al., 2023; Zhang et al., 2024).

Animal behavior

AI significantly improves monitoring and analysis of animal behavior, offering greater precision and efficiency compared to traditional visual assessment methods. AI technologies make it possible to identify individual animals and monitor them continuously, resulting in improved animal welfare and optimized breeding management. Pig behavior changes depending on environmental conditions and the breeding procedures performed (e.g., feeding, water intake, zootechnical procedures). It can take a calm form, which does not disturb the herd, or an aggressive one, manifested, for example, by tail biting and mount attempts (Figure 4). Observation of behavior is crucial as it provides important information about the animals’ health and welfare.

Figure 4.

Examples of four different pig behaviors: (a) drinking; (b) mount attempts; (c) aggression; (d) lying down (Wang et al., 2022).

1. Water intake behavior

Water plays a key role in the daily activities of pigs, not only as an essential component of the diet, but also as an indicator of potential health problems (Chen et al., 2020 a; Ji et al., 2020). The amount of water intake can be monitored using RFID systems, in which transmitters placed on the animals’ ears interact with receivers near drinkers. The data is then analyzed using linear regression models to determine the relationship between water intake and animal health. However, RFID technology requires the use of electronic tags, which can cause discomfort and stress to animals (Zin et al., 2018; Yang and Xiao, 2020).

An alternative to RFID has become the use of cameras and ML technology to monitor pigs’ drinking behavior. Kashiha et al. (2013) used image binarization and distance analysis between key points of the animal’s body outline and its center of mass. Yang et al. (2018) introduced an image occupation index to improve identification accuracy, while Tan and Zhu (2018) developed a method based on body contour feature vectors, which improved detection accuracy.

To increase the efficiency of the analyses under harsh environmental conditions (e.g., variable lighting, partially covered animals), Ji et al. (2020) and Chen et al. (2020 a) used the ResNet-50 model to extract spatial features and long short-term memory (LSTM) to identify water in-take behavior. This method allows precise monitoring of pigs even under conditions of complete or partial obstruction.

2. Aggression behavior

Aggression in pig farming is a significant problem resulting mainly from inadequate living conditions, food shortages, limited access to water and excessive stocking density. In pigs, it manifests itself by biting of the tails, ears, and sides of the body, and in gestating and lactating sows, it can lead to biting the vulvae and even biting the pig-lets. Cannibalism is most common on farms without bedding, where the limited opportunity to perform natural exploratory behaviors increases stress and the risk of aggression (Meer et al., 2017). Manual detection of aggressive behavior in large herds is difficult, so the use of AI in monitoring can improve animal welfare, increase production efficiency and reduce economic losses.

The development of deep learning in ML has made it possible to detect herd aggression more effectively through automated image feature analysis and real-time data processing. 2D and 3D CNN algorithms, multi-scale fusion, and spatio-temporal feature extraction enable more precise pattern recognition of aggressive behavior (Gao et al., 2019; Chen et al., 2020 b; Gan et al., 2021).

Gao et al. (2019) applied multi-scale feature fusion to a 3D CNN, achieving 95.7% accuracy in detecting aggressive behavior of pigs under harsh environmental conditions. Chen et al. (2020 b) used the VGG-16 model combined with a LSTM memory network for spatio-temporal analysis, achieving 98.4% accuracy. In contrast, Gan et al. (2021) developed a method based on analyzing key points of the pigs’ bodies, taking into account parameters of linear movement intensity, angular movement and spatial dependence, which allowed for the effective identification of aggression in groups of animals.

This research confirms that the use of AI in the automatic detection of aggression in pigs can significantly improve animal welfare and herd management efficiency, providing breeders with precise data for early intervention.

Sound detection

Monitoring livestock using video cameras and ML algorithms makes it possible to obtain a wide range of data on herd performance. However, in addition to image analysis, the detection and analysis of sounds made by animals are becoming an important diagnostic tool. The development of AI technology has made it possible to effectively detect specific sounds and interpret them in terms of the health and functioning of a group of animals. These sounds are important indicators of animal health, and in pigs in particular, they can signal respiratory diseases, which in some farms account for up to 15% of mortality (Choi et al., 2003; Ayrle et al., 2016).

Initial studies have shown that the frequency band of noise under pig farm conditions is below 5 kHz, which coincides with the range characteristic of coughing sounds. To more effectively eliminate noise generated by fans and other mechanical equipment, Dong et al. (2017) proposed an algorithm to reduce unwanted sounds and amplify pig cough signals and other vocalizations associated with their behavior.

Advances in artificial intelligence have enabled the development of various deep learning models for recognizing and analyzing pig cough sounds under challenging environmental conditions. Cang et al. (2020) used a combination of deep learning models and neural networks to accurately recognize different types of pig vocalizations. In contrast, Chen et al. (2021) used a CNN model to identify sounds associated with sow estrus. To improve classification performance, the authors developed a two-level AI architecture: the first part is responsible for collecting and transmitting sounds to the detector, and the second part is responsible for classifying them. The results showed effectiveness in distinguishing sounds of sows in heat from boar vocalizations.

In the same year, Yin et al. (2021) proposed an AlexNet model that used neural networks and spectral feature analysis to improve the accuracy of pig cough sound recognition. Zhao et al. (2020) presented an acoustic model DNN-HMM, which improved the performance of pig cough detection compared to the GMM-HMM model, reducing the word error rate (WER) to 8.03%. Yan et al. (2016) focused on analyzing four basic types of sounds made by sows during lactation: the sounds of piglets feeding, drinking, taking feed and chewing without food. They used a skewness clustering algorithm to process the signals, and a SVM was used for classification. The developed model achieved very high performance in recognizing sounds, with accuracy reaching 100% for some classes of signals. Modern AI models, such as DNN-HMM, CNN and AlexNet, enable the efficient detection and classification of pig sounds with high accuracy, paving the way for their application in automated breeding systems. Implementation of these technologies can help improve breeding efficiency and early detection of health problems, which is crucial for modern pig production.

Pig health

One of the biggest threats to the pig industry in recent years has been ASF, which has caused significant economic losses and reductions in pig populations around the world. For example, in China, the largest pork producer, ASF has led to a 40.5% drop in production, and the global number of pigs has decreased by 19% (Ma et al., 2021). Infectious disease outbreaks pose a significant threat to livestock, so it is becoming crucial to implement early detection and prevention systems to minimize losses and protect herd health (Fernández-Carrión et al., 2017).

The health of pigs depends on a number of factors that affect their function and well-being. In addition to technologies that enable recognition of coughing sounds, an important indicator of respiratory diseases, proper nutrition and monitoring of behavior, including aggression, also play a key role (Chae et al., 2024; Matthews et al., 2016). Physiological parameters such as body temperature, changes in limbs and the animal’s posture are an important part of assessing the health of pigs (Conte et al., 2014; Soerensen et al., 2015). In large herds, detecting changes in individuals is a challenge. On farms with thousands of animals, manual observation of disease signs, such as locomotion disorders or elevated body temperature, often proves inaccurate or even ignored. Therefore, effective surveillance of pig health requires round-the-clock monitoring.

1. Body temperature

Body temperature is one of the key indicators of the body’s homeostasis and plays an important role in the diagnosis of the early stages of diseases. However, its manual measurement is labor-intensive, requires the presence of at least two people and causes stress in animals, which can affect the accuracy of the result. The normal body temperature of pigs is in the range of 38–40°C, and its increase may indicate the development of a disease process (Zhang et al., 2025). In sows, body temperature varies depending on the phase of the sexual cycle, so these changes should be taken into account when interpreting measurement results (Sánchez-Giménez et al., 2024).

To improve temperature monitoring and enable rapid response to the first signs of disease, smart measurement systems are needed. Qin (2015) used infrared sensors to detect the body temperature of pigs in conjunction with RFID. By implementing a multi-point temperature monitoring system, it was possible to intelligently detect thermal changes in large groups of pigs, which allows early identification of disease conditions and precise management of animal health. A diagram of how this system works is shown in Figure 5.

Figure 5.

Structure of an infrared temperature sensing system using RFID technology (Zhang et al., 2019).

Research results indicate that infrared temperature measurement technologies enable the non-invasive, rapid, and stress-free monitoring of pig health, eliminating the need for manual measurements. In addition, body temperature measurements on specific areas of the body, such as the base of the ear and the eye area, show a high correlation with internal temperature, which increases the precision of detection of disease states (Dewulf et al., 2003).

Telemetry, wireless sensor networks, infrared technology and other temperature measurement methods minimize stress on livestock, which is in line with animal welfare guidelines. In addition, they reduce measurement effort, improve efficiency and support the development of large-scale intensive farming (Berry et al., 2003; Libo et al., 2010). The thermal imaging system, which is based on infrared image analysis, has gained significant interest in modern breeding. This technology is characterized by high precision, allowing temperature measurement with an accuracy of 0.08°C. Importantly, this method is completely non-invasive and eliminates the risk of disease transmission, unlike traditional methods that involve inserting a thermometer into the rectum (Costa et al., 2007). In addition, the use of infrared thermography to monitor vulvar temperature provides key information on ovulation in sows, which can help optimize reproductive processes. According to many researchers, infrared thermography is a promising tool for monitoring body temperature in pigs, while also considering biochemical changes within the body (Schmidt et al., 2014).

Research indicates that modern temperature measurement technologies can effectively replace contact methods that carry the risk of disease transmission. The introduction of thermal imaging cameras, infrared sensors and RFID systems opens up new prospects for monitoring pig health in an automated, rapid and stress-free manner. The development of wireless technologies enables the full integration of these technologies into livestock management systems, significantly improving the efficiency of early diagnosis and reducing labor costs.

2. Posture disorders

Lameness is the second most important cause of economic losses in pig farming, right after reproductive problems, accounting for about 15% of sow losses in a herd (Heinonen et al., 2006; Paula et al., 2024). The condition affects both animal welfare and production efficiency, limiting mobility and causing pain and discomfort. The early stages of lameness often go undetected due to a lack of systematic observation and the inadequate precision of traditional methods of assessing locomotion. Animals suffering from lameness show reduced locomotor activity, reduced willingness to consume feed and water, and more frequent lying down. This results in behavioral abnormalities, as prolonged avoidance of movement and assuming a lying position is not consistent with the pigs’ natural behavior. A study by Heinonen et al. (2006) found that 10% of animals with lameness were not identified as lame by their owners or did not receive treatment, indicating the need to implement more precise diagnostic systems. The use of accelerometers provides an effective tool for monitoring locomotion and detecting changes in pig activity. These sensors, attached to the animal’s limbs, record changes in velocity along various directional axes and convert them into vector data that enable analysis of movement patterns (Chapa et al., 2020). In addition to motion sensors, vision systems with AI-based image analysis are increasingly being used. Paula et al. (2024) developed a database of video recordings showing sows with varying degrees of lameness, evaluated by experts using the swine Locomotion Scoring System developed by Zinpro Corporation. The score is based on a four-point scale (0–3), where 0 indicates no signs of lameness and 3 indicates severe lameness, preventing free movement (Table 1). The use of deep learning and ML algorithms in 2D image analysis allows automatic detection of lameness and assessment of locomotion in sows in various positions, including both lateral and dorsal views. This technology enables faster and more accurate identification of animals exhibiting locomotion abnormalities, significantly speeding up diagnosis.

Table 1.

Pig locomotion scoring system to assess lameness (Paula et al., 2024).

SCORESDESCRIPTION
0No signs of lameness. The animal moves easily, showing full comfort of movement.
1Initial signs of lameness in one leg can be seen. The animal is reluctant to bear weight but continues to move without much difficulty.
2Lameness involves one or more legs. The animal exhibits compensatory behavior such as dipping of the head or arching of the back.
3The animal shows considerable reluctance to walk or bear weight on its limbs. Moving the animal around the farm is difficult.

Advanced machine vision (Computer Vision) models combined with AI algorithms can independently analyze images, identifying abnormal movement and posture patterns. Automated data analysis streamlines the process of detecting locomotion problems, minimizing human error and the subjectivity of judgments. Integrating these systems with farm monitoring enables the ongoing assessment of sow health, allowing for early veterinary intervention and improved animal welfare.

Microclimate in pig facilities

Pigs are a species in which breeding advances have significantly improved growth rates and carcass meatiness. While these changes have benefited feed conversion and production efficiency, they are also associated with reduced resistance to stress factors, making control of environmental conditions a key aspect of modern breeding (Laghouaouta et al., 2024). Among the most important parameters affecting the health and welfare of pigs are temperature, humidity and air quality, which determine both production efficiency and the environmental impact of pig farming and breeding. Modern AI-based piggery microclimate monitoring systems use sensors and data analysis to continuously monitor environmental parameters. When deviations from recommended standards are detected, they can automatically adjust conditions by regulating gas concentrations, temperature and humidity (Seo et al., 2025). This approach not only improves the welfare of animals, but also optimizes production performance and minimizes the risk of diseases related to environmental stress.

Air quality plays a crucial role in herd health, affecting both animal welfare and the well-being of farm workers. In the past, environmental monitoring in pig farming has focused mainly on the presence of ammonia (NH3) (Lewis et al., 2023). However, modern research shows that other gases, such as carbon dioxide (CO2), sulfur dioxide (SO2) and nitrogen oxides (NO2), high concentrations of which can cause serious health consequences, are equally important. In a study by Almalawi et al. (2022 a, b), a predictive model was developed for the detection of the air pollutants CO2, SO2, NO2, and particulate matter, enabling precise control of air quality in pig houses. In addition, Athira et al. (2018) and Navares and Aznarte (2020) analyzed the effectiveness of traditional ML algorithms and deep learning algorithms in predicting NH3 concentrations, taking into account factors such as temperature, humidity, ventilation and CO2 levels. The results showed that an increase in NH3 correlates with an increase in CO2 and high humidity, confirming the need to integrate intelligent systems in the management of the piggery microclimate. Automated monitoring systems, using AI and deep learning algorithms, allow precise analysis of environmental changes, enabling faster detection of health risks, automatic adjustment of ventilation and temperature, minimization of stress and risk of disease spread, reduction of greenhouse gas emissions, thus improving the sustainability of breeding.

The use of modern technology enables the maintenance of optimal environmental conditions and preventing health problems related to temperature and air quality, which is crucial for the performance and welfare of pigs.

Recognition, differentiation, and identification of pigs

Identification of individual animals in pig farming is a key element in production management (including welfare), in tracing origin, and in monitoring health, behavior and growth. Traditional methods of marking pigs (e.g. ear tags, tattoos, microchips) have numerous disadvantages: they can be stressful, subject to damage or loss, and require manual intervention by humans.

With the development of precision livestock farming (PLF), more and more research is focusing on automated methods such as biometric methods, image analysis, sensors, and AI algorithms (Ermetin, 2023), According to Bugge et al. (2011), biometric methods of animal identification include various techniques for recognizing individuals based on their unique biological features, such as fingerprint structure, iris pattern, blood vessel pattern, voice, or specific individual behavioral characteristics. Biometric methods are characterized by high accuracy and reliability, and many are non-invasive. Sanket et al. (2023) demonstrated in their study that an imaging method based on texture features and ear vein patterns is highly effective for identifying individual pigs and can reduce stress and the risk of tissue damage. As Ermetin (2023) argues, PLF enables automatic data collection (e.g. weight gain, feed consumption, behavioral observation), better production management (e.g. precise feed dosing, temperature control), monitoring animal health, which can result in a significant reduction in mortality and improvement of animal welfare. Berckmans (2004) cites the rapid detection of abnormalities and the ability to react in real time as the key advantages of online systems for monitoring health, behavioral, and production parameters. This allows for improved animal welfare, improved production efficiency, and reduced environmental impact.

Summary

AI is playing an increasingly important role in pig farming, enabling health monitoring, reproductive management and optimization of production processes. The use of ML algorithms enables more accurate predictions of weight gain, optimization of feeding strategies and precise monitoring of estrus, which increases insemination efficiency and improves reproductive performance. The use of sound analysis enables early detection of respiratory diseases, reducing pig mortality by up to 15%. AI-based intelligent microclimate management systems improve rearing conditions by reducing heat stress and optimizing ventilation, resulting in better production results. Automation of breeding processes using RFID technology, vision systems and IoT contributes to more precise herd management and better use of resources. Despite the numerous benefits, the implementation of AI in pig farming requires further research into algorithm optimization, sensor durability and implementation costs.

List of abbreviations

African Swine Fever (ASF)

is an infectious viral disease of pigs, wild boar and wild boar pig hybrids.

Artificial Intelligence (AI)

is a scientific field that focuses on building computer systems that can perform tasks that require human intelligence, such as learning, decision-making, image recognition, language processing or data analysis.

Big Data (BD)

is a collection of complex and rapidly generated data that requires advanced analysis methods. Combined with artificial intelligence (AI) and machine learning (ML), it enables data from Internet of Things (IoT) systems to be processed in data warehouses (DWH) and analyzed using deep learning (DL) models, supporting the optimization of decision-making processes.

Convolutional Neural Network (CNN)

is a type of artificial neural network specifically designed for processing grid-like data, such as images, audio signals, or spatial data. CNNs are widely used in image recognition, video analysis, natural language processing and pattern detection in sensory data.

Deep Belief Networks (DBNs)

are a type of multilayer neural network that uses probabilistic modeling to learn complex patterns in data. They are used in image recognition, audio signal processing and analysis of large data sets.

Deep Neural Network-Hidden Markov Model (DNN-HMM)

is a hybrid machine learning model that combines deep neural networks (DNN) with hidden Markov models (HMM).

Feed Conversion Ratio (FCR)

determines the amount of feed consumed per 1 kg of body weight gain.

Gaussian Mixture Model-Hidden Markov Model (GMM-HMM)

is a hybrid computer model that combines analysis of sounds (GMM) with their time sequence analysis (HMM) for effective sound recognition.

Internet of Things (IoT)

is a concept in which everyday objects, devices and machines are equipped with sensors, software and other technologies that enable them to exchange data over the Internet or other communication networks.

Light Detection and Ranging (LiDAR)

is an optical technology that uses laser pulses to precisely measure the distance, shape and structure of objects in space.

Long Short-Term Memory (LSTM)

is a type of recurrent neural network designed to efficiently process sequential data and deal with long-term dependencies in time series and other tasks requiring long-term memory.

Machine Learning Technology (MLT)

refers to technologies and tools related to machine learning (ML).

Precision Livestock Farming (PLF)

is a livestock management system based on advanced technology for optimizing production conditions and animal welfare.

Radio-Frequency Identification (RFID)

is a technology that enables wireless identification of objects using radio waves, and is used, among other things, in animal breeding to monitor and track individuals in real-time.

Residual Network 50 (ResNet-50)

is an advanced artificial intelligence model that analyzes images and learns to recognize various patterns, such as behavior, body positions or the presence of animals in camera footage.

Smart Sow Breeding (SSB)

is an advanced approach to pig reproduction management that uses modern technologies such as AI, IoT, BD analysis and analytical tools to optimize the reproduction process and improve breeding efficiency.

Sparse Autoencoder (SAE)

is a deep learning model that automatically extracts the most relevant features of data, ignoring noise and less important information.

Support Vector Machine (SVM)

is a classical machine learning algorithm mainly used for data classification and regression. Its goal is to find the optimal boundary (hyperplane) that best separates data belonging to different classes.

VGG-16

is a convolutional neural network (CNN) used for image classification, image recognition and object detection.

You Only Look Once (YOLO)

is a model used in real-time object detection.

Acknowledgements

The work was financed from the research potential of the Department of Animal Breeding and Product Quality Assessment.

DOI: https://doi.org/10.2478/aoas-2026-0012 | Journal eISSN: 2300-8733 (formerly 1642-3402) | Journal ISSN: 1642-3402
Language: English
Submitted on: May 7, 2025
Accepted on: Jan 19, 2026
Published on: Oct 6, 2026
Published by: National Research Institute of Animal Production
In partnership with: Paradigm Publishing Services
Publication frequency: 4 issues per year
Related subjects:

© 2026 Ewa Skrzypczak, Agnieszka Jędrzejczak, Karolina Szulc, Agnieszka Ludwiczak, Przemysław Racewicz, Piotr Ślósarz, Marek Babicz, Maria Kliks, Magdalena Szyndler-Nędza, Kinga Kropiwiec-Domańska, published by National Research Institute of Animal Production
This work is licensed under the Creative Commons Attribution 4.0 License.