REVIEW

RGB-based machine vision for enhanced pig disease symptoms monitoring and health management: a review

Md Nasim Reza1,2https://orcid.org/0000-0002-7793-400X, Kyu-Ho Lee1,2https://orcid.org/0000-0002-3186-8975, Eliezel Habineza2https://orcid.org/0000-0003-0364-420X, Samsuzzaman1https://orcid.org/0009-0006-3976-8975, Hyunjin Kyoung3https://orcid.org/0000-0001-5742-5374, Young Kyoung Choi4https://orcid.org/0009-0004-9398-5626, Gookhwan Kim5https://orcid.org/0000-0002-7278-3476, Sun-Ok Chung1,2,*https://orcid.org/0000-0001-7629-7224
Author Information & Copyright
1Department of Agricultural Machinery Engineering, Graduate School, Chungnam National University, Daejeon 34134, Korea
2Department of Smart Agricultural Systems, Graduate School, Chungnam National University, Daejeon 34134, Korea
3Division of Animal and Dairy Science, Chungnam National University, Daejeon 34134, Korea
4Dawoon Co., Ltd., Incheon 22847, Korea
5National Institute of Agricultural Sciences, Rural Development Administration, Jeonju 54875, Korea
*Corresponding author: Sun-Ok Chung, Department of Agricultural Machinery Engineering, Graduate School, Chungnam National University, Daejeon 34134, Korea. Tel: +82-42-821-6712, E-mail: sochung@cnu.ac.kr

© Copyright 2025 Korean Society of Animal Science and Technology. This is an Open-Access article distributed under the terms of the Creative Commons Attribution Non-Commercial License (http://creativecommons.org/licenses/by-nc/4.0/) which permits unrestricted non-commercial use, distribution, and reproduction in any medium, provided the original work is properly cited.

Received: Oct 16, 2024; Revised: Nov 15, 2024; Accepted: Nov 18, 2024

Published Online: Jan 31, 2025

Abstract

The growing demands of sustainable, efficient, and welfare-conscious pig husbandry have necessitated the adoption of advanced technologies. Among these, RGB imaging and machine vision technology may offer a promising solution for early disease detection and proactive disease management in advanced pig husbandry practices. This review explores innovative applications for monitoring disease symptoms by assessing features that directly or indirectly indicate disease risk, as well as for tracking body weight and overall health. Machine vision and image processing algorithms enable for the real-time detection of subtle changes in pig appearance and behavior that may signify potential health issues. Key indicators include skin lesions, inflammation, ocular and nasal discharge, and deviations in posture and gait, each of which can be detected non-invasively using RGB cameras. Moreover, when integrated with thermal imaging, RGB systems can detect fever, a reliable indicator of infection, while behavioral monitoring systems can track abnormal posture, reduced activity, and altered feeding and drinking habits, which are often precursors to illness. The technology also facilitates the analysis of respiratory symptoms, such as coughing or sneezing (enabling early identification of respiratory diseases, one of the most significant challenges in pig farming), and the assessment of fecal consistency and color (providing valuable insights into digestive health). Early detection of disease or poor health supports proactive interventions, reducing mortality and improving treatment outcomes. Beyond direct symptom monitoring, RGB imaging and machine vision can indirectly assess disease risk by monitoring body weight, feeding behavior, and environmental factors such as overcrowding and temperature. However, further research is needed to refine the accuracy and robustness of algorithms in diverse farming environments. Ultimately, integrating RGB-based machine vision into existing farm management systems could provide continuous, automated surveillance, generating real-time alerts and actionable insights; these can support data-driven disease prevention strategies, reducing the need for mass medication and the development of antimicrobial resistance.

Keywords: Smart livestock production; Pig health monitoring; Machine vision; Pig behavior pattern; Artificial intelligence

INTRODUCTION

Pig production plays a significant role in global meat production, with pork being one of the most consumed meats worldwide [1]. Indeed, according to the Food and Agriculture Organization (FAO), pork accounts for approximately 38% of global meat production [2]. The demand for pork is expected to increase further, driven by population growth, urbanization, and rising incomes in developing countries [3]. However, the pig industry faces several challenges, including disease outbreaks, environmental concerns, and the need for sustainable production practices.

Modern pig farms are crucial for meeting the increasing demand for pork, but their larger scales of operation pose challenges for breeders, including shorter monitoring periods for each pig [4]. Identifying health issues and improving living conditions for vulnerable pigs is essential for maintaining their welfare [5]. Respiratory and digestive diseases are significant concerns, leading to reduced productivity and profits if not managed effectively through proper prevention strategies and veterinary care [6]. Disease outbreaks can have devastating economic effects on pig farms and threaten food security [7]. Traditional disease monitoring methods depend heavily on observation, which can be labor-intensive, time-consuming, and susceptible to subjectivity and human error. Furthermore, close visual observation may stress animals [810] and may not be reliably effective in detecting early signs of disease or identifying individuals that require medical attention [11].

Driven by rapid scientific and technological progress, significant advances have been made in integrating information technology with agriculture and livestock industries [12]. In particular, the incorporation of machine vision sensing has elevated this integration to new levels: the use of machine vision and RGB imaging technology in agriculture and livestock has seen significant growth due to the increasing availability of affordable and high-resolution cameras, coupled with advances in image processing algorithms [13]. These technologies have the potential to revolutionize the health management of pigs by providing real-time, non-invasive, and automated monitoring of behavior, health, and environmental conditions [11].

Machine vision, RGB imaging, and artificial intelligence (AI) equip computers with the remarkable ability to extract and organize meaningful information from digital images and videos. In essence, machine vision attempts to replicate the sophisticated visual perception of humans and animals, while RGB imaging—a fundamental pillar of machine vision—involves capturing visual data within the visible light spectrum, encompassing the red, green, and blue color channels [14]. Various image processing approaches, such as segmentation and extraction, aid in the automatic detection of diseases and visual symptoms, facilitating pig farm management [6]. Their primary focus is on individual identification using properties like color, texture, and shape, aiding in assessing body size, weight, and posture [15]. Furthermore, recent research has utilized advanced technologies like object detection [16], support vector machines (SVMs) [17], and convolutional neural network (CNN)-based methods [18,19] to identify sick pigs and their symptoms.

These methods have been utilized to enhance pig monitoring and health management on farms as early detection through single-image or video analysis enables farmers to intervene quickly, improving animal welfare and minimizing the spread of disease. Studies have shown that early intervention significantly reduces mortality rates and improves treatment efficacy, contributing to enhanced productivity [19]. Moreover, machine vision and RGB imaging can be used to monitor environmental conditions (e.g., temperature, humidity, and air quality), which can have a significant impact on pig health. By integrating data from various sensors and cameras, a comprehensive picture of the farm environment can be obtained, enabling more effective management of housing conditions. However, several challenges need to be addressed in order to fully realize this potential. The objective of this review was to provide an overview of the current state of the art in machine vision and RGB imaging for pig disease monitoring and health management.

HEALTH MONITORING AND VISUAL SYMPTOMS OF PIG DISEASES

Recognizing diseases and other health issues in pigs primarily relies on visual symptoms (e.g., lethargy, reduced appetite, shivering, and weight loss), but detecting sickly individuals within larger groups can be challenging, especially for less experienced farm workers. For example, respiratory diseases can be categorized based on their rapid spread and severity or their prolonged presence among a large population of pigs [20]; while the severity varies, visual symptoms often start with the respiratory system itself and become manifest through sneezing, snuffling, and nasal discharge, which are indicators of irritation, or through eye issues like tear staining [21]. In severe cases, facial deformity can occur, with pigs exhibiting twisting or shortening of the snout [22]. In piglets, stunted growth could also be a sign of respiratory illness [23]. Early detection through these visual symptoms is crucial for prompt intervention and improved pig health.

Digestive diseases often manifest through more general symptoms, such as diarrhea, vomiting, and abdominal discomfort. Severe conditions like stomach ulcers present as dark, coffee-like stool [24]. Diarrhea poses the greatest threat, particularly to weaned pigs, and is accompanied by weight loss, teeth grinding, hunching, and bloating [25]. Other symptoms include high temperature, neck swelling, depression, vomiting, reluctance to feed, darkened skin over swollen areas, jowl swelling, lethargy, coma, convulsions, coughing, and jaundice [6]. The primary cause of piglet crushing and overlaying is the size difference between the mother pig and the newborn piglet, often when the mother lies down to rest or nurse [26]. However, it can also result from the mother’s illness or behavioral issues, causing her to neglect or inadvertently harm the piglets. Insufficient segregation between piglets and larger pigs on the farm exacerbates the problem, leading to noticeable instances of crushing [27]; piglets can also be crushed due to various factors, including disease, hunger, hypoglycemia, splay legs, joint issues, and other related conditions [28]. Each of these risks could be predicted by visual cues and are thus potential targets for machine vision-based interventions.

Behavior patterns of pigs and environmental factors on the farm can contribute, including inadequate pig and litter separation, excessive straw bedding affecting piglet mobility, poor rail or crate design, and insufficient temperature and lighting [27]. The sound of a screaming piglet may indicate crushing, with dead piglets often found under the mother or exhibiting injuries consistent with being crushed [29]. Lame or squealing piglets, congenital tremors, splayed limbs, and limited mobility suggest crushing if accompanied by distressed piglet sounds [30].

In summary, there are numerous common visual cues of illness in pigs, including fractured bones, bruises, bleeding, decreased viability in newborns, scratches from piglet teeth on the udder indicating mastitis or agalactia, immobility, ear and tail bites, lameness in sows, and behavioral issues in gilts such as savaging [31]. In piglets, failure may manifest through hunger, hypoglycemia, joint issues, weakness at birth, and exposure to cold temperatures [32]. Since visual changes are often the earliest indicators of health problems, RGB imaging provides a non-invasive and proactive method for monitoring pig populations, enabling early detection and intervention to minimize losses and improve pig welfare.

RGB IMAGING: MACHINE VISION, SENSORS, AND DATA PROCESSING

Machine vision aims to replicate human vision capabilities using algorithms and machines, with the core goal of enabling computers to interpret and extract meaningful insights from digital images or videos. This process involves several stages, as shown in Fig. 1. The first step, image acquisition, captures visual data using cameras or sensors—such as RGB or infrared sensors—which translate real-world information into digital pixel grids. In animal health monitoring, infrared sensors often complement RGB cameras by detecting temperature changes that could indicate fever [8].

jast-67-1-17-g1
Fig. 1. A schematic showing the fundamental processing steps in machine vision from initial image acquisition through to final image interpretation and analysis.
Download Original Figure

Once images are captured, pre-processing techniques such as filtering, noise reduction, color correction, and histogram equalization are applied to improve image quality and remove irrelevant detail. Pre-processing is particularly important in pig health monitoring to enhance features like skin lesions or abnormal tissue growth, which might otherwise go unnoticed [5]. Following pre-processing, feature extraction identifies distinctive patterns (e.g., edges, corners, textures, and colors) that are crucial for analysis and recognition. For example, changes in pig skin color or texture may indicate conditions like dermatitis or other infections. The extracted features are then transformed into suitable formats for processing and analysis. In the object detection and recognition phase, algorithms such as CNNs are often employed to locate and classify objects, including identifying individual pigs and detecting behavioral anomalies [5]. The image understanding step provides contextual information about the visual data, such as tracking pig movements or monitoring interactions between animals. Finally, machine learning and deep learning techniques further enhance system performance by automating feature extraction and enabling predictive analysis based on the visual data. These methods allow for early detection of health issues in pigs, improving the accuracy and timeliness of interventions [8].

RGB imaging is a foundational technique used in digital photography, machine vision, and image processing. Each pixel in an RGB image is represented by the three primary color channels, where the intensity of each channel determines the color of a pixel, enabling a vast array of colors to be created through combination. Fig. 2 shows the electromagnetic radiation spectrum, highlighting the visible spectrum band. Following the principle of additive color mixing, varying intensities of red, green, and blue light produce different colors, with full illumination resulting in white light and an absence in all channels yielding black. The color gamut, defining the range of representable colors in an RGB color space, varies among devices and technologies, influencing perceived color accuracy. Manipulating the intensity of each channel enables diverse color effects and adjustments. Color filtering techniques are often implemented to selectively capture specific wavelengths of light, enhancing image quality and discerning between colors. Besides RGB, alternative color spaces (e.g., CMYK, HSL, and HSV) offer different methods for color representation and manipulation, which are tailored for specific applications in imaging and machine vision.

jast-67-1-17-g2
Fig. 2. An illustration of electromagnetic bands ranging from radio waves to gamma rays, highlighting the visible light spectrum.
Download Original Figure
RGB imaging technologies using cameras and sensors

Precision livestock farming utilizes intelligent technology for comprehensive monitoring of individual animals in farms, addressing a critical challenge in disease monitoring and prevention. Early disease detection is essential for averting large-scale outbreaks and economic losses. Cameras have become widely available and affordable for scientific purposes over the past two decades. The predominant image sensor devices in use are standard digital and surveillance cameras, which capture visible light spectra for generating color and grayscale images [33]. Camera sensors have the advantage of offering more rapid data capture compared to other sensor types in pig farms [34]. Various types of cameras (including charge-coupled device [CCD], infrared, depth, and 3D cameras) are used for animal monitoring and surveillance, each providing unique information [34]. More complex arrays of images—such as three-dimensional (3D), multispectral, and hyperspectral image cameras—are also available but tend to be costly. Each imaging technology suits particular applications. However, the current review primarily focuses on RGB cameras, which are extensively utilized in various studies conducted on pig farms. Automated identification of diseases and behaviors is crucial, with cameras playing an increasingly vital role in observing abnormal behaviors. Traditional farm inspections are inadequate for monitoring individual pigs effectively, considering factors like radiation, floor type, growth stage, and health status [35]. Fig. 3 and Table 1 show the common RGB cameras used in the pig farm for disease symptom detection and behavior and activity monitoring.

jast-67-1-17-g3
Fig. 3. Various commercial RGB imaging sensors used in pig farms for disease symptom detection and behavior and activity monitoring. (A) Raspberry Pi camera module V2, (B) Mi 360 webcam, (C) EXview HAD CCD, (D) Microsoft Kinect v1, (E) Microsoft Kinect v2, (F) VIVOTEK IB836BA-HF3, (g) Hikevision DS-2CD2142FWD-I, (H) Microsoft OEM Life Cam, (I) Intel RealSense, (J) FL3-U3-88S2C-C (K) IFM O3D313, (L) IPC-HFW1230S-S4, (M) TOF 640, (N) Hero 4, and (O) Nikon D5100.
Download Original Figure
Table 1. Commonly used type of RGB cameras used in farming environments for disease symptom detection and, behavior and activity monitoring of pigs
Camera model Sensor type Frame size (pixel) Frame rate (fps) Manufacturer
Camera Module v2 Sony IMX 219 PQ 3,280 × 2,464 30, 60 Raspberry Pi Foundation, Cambridge, UK
HQ Camera Sony IMX477 4,056 × 3,040 30, 60 Raspberry Pi Foundation, Cambridge, UK
Mi 360 webcam MJSXJ05CM 1,920 × 1,080 25 Xiaomi Inc., Beijing, China
EXview HAD CCD Sony RF293 640 × 480 Sony Corporation, Tokyo, Japan
Microsoft Kinect v1 Structured light 640 × 480 30 Microsoft Corporation, Washington, USA
Microsoft Kinect v2 Time of Flight (ToF) 1,920 × 1,080 30 Microsoft Corporation, Washington, USA
VIVOTEK IB836BA-HF3 1/2.7” Progressive CMOS 1,920 × 1,080 30 Vivitek Inc., Taipei, Taiwan
DS-2CD2142FWD-I 1/3” Progressive Scan CMOS 2,688 × 1,520 30, 60 Hikvision, Zhejiang, China
Microsoft OEM Life Cam Size-Unspecified CMOS 1,920 × 1,080 30 Microsoft Corporation, Washington, USA
Intel RealSense Rolling Shutter 1,920 × 1,080 30 Intel Corporation, Santa Clara, CA, USA
FL3-U3-88S2C-C 1/2.5” CMOS 4,096 × 2,160 21 Teledyne FLIR, Oregon, USA
IFM O3D313 352 × 264 25 IFM Electronic gmbh, Essen, Germany
IPC-HFW1230S-S4 1/2.7” CMOS 1,920 × 1,080 25, 30 Dahua Technology Co., Ltd, Seoul, Korea
DH-SD1A203T-GN 1/2.8” CMOS 1,920 × 1,080 25, 30 Dahua Technology, Hangzhou, China
TOF 640 IMX586 CMOS 3,000 × 4,000 20 Basler AG, Ahrensburg, Germany
D5100 CMOS 4,928 × 3,264 4 Nikon, Tokyo, Japan
Hero 4 CMOS 3,840 × 2,160 30 GoPro Inc., San Mateo, CA, USA
DCS760 APS-H CCD 3,032 × 2,028 1.5 Kodak, New York, USA
Download Excel Table

Image acquisition is the initial step in image-based analysis and involves obtaining numeric information through cameras [33,36]. Analyzing pig behaviors via image processing enables accurate real-time recording without disrupting their normal activities [37]. CCD cameras detect object pixels in red, green, and blue bands, converting them into parameters like grey, hue, saturation, and intensity using various image processing algorithms [36]. Video processing enhances sound captured in video files and adjusts images accordingly, often using filter algorithms for editing purposes [38]. Different software and peripheral devices aid in loading video files into the system, allowing users to compile and process images and videos using pre-filters, intra-filters, and post-filters [39]. Pre-processing of input images involves restoration, augmentation, or presentation of real data as required. Segmentation divides the image into constituent parts, extracting specific characteristics for further analysis [40]. Segmented images are then fed into classifiers or image understanding systems for interpretation and classification. Image classification assigns distinct parts or segments of an image to various objects with corresponding labels. An image comprehension system must detect relationships between different objects to generate a comprehensive description of the image [38].

Factors influencing RGB imaging quality and accuracy

The integration of RGB imaging into pig farms holds promising potential for streamlining livestock management practices. From remote health assessments to automated weight estimation, camera-based monitoring offers a non-invasive way to gather valuable insights into pig well-being and productivity [41]. However, the success of such systems depends on the quality and reliability of the captured images. Within the unique environment of a pig farm, several factors combine to affect RGB image clarity and, consequently, the accuracy of any analysis derived from the images [6]. Lighting conditions wield substantial influence; optimal lighting, whether natural or artificial, is crucial for clear and consistent image capture, with variations potentially impacting image quality [42]. The choice and positioning of cameras are equally significant; high-resolution cameras positioned strategically can mitigate obstacles and ensure comprehensive coverage of the farm [34]. Optimizing the camera distance, angle, and height above the ground is crucial, as longer distances increase random error while shorter distances enhance accuracy. Adjusting these parameters ensures the capture of the entire pen while minimizing the distance to the pigs [43]. Furthermore, environmental conditions like fluctuating light levels, dust accumulation, and humidity pose significant challenges. Camera setup, including resolution, lens quality, and calibration, plays a crucial role [44].

Additionally, the inherent characteristics of the pigs themselves—such as their coloration, movement, and body positioning—introduce further complexities for image analysis algorithms [45]. Allowing pigs to move freely presents challenges in image processing, including reduced height repeatability and motion blur, necessitating extra filtering to remove low-quality images [43]. Cameras should effectively capture fast movements and changes in posture to provide accurate monitoring data in farm conditions [15]. The quality of software tools and image processing algorithms is thus critical to facilitate the extraction of meaningful insights from RGB images [8].

There is a lack of extensive high-quality datasets and data standards for pig farming data, as commercial and biosecurity restrictions make data collection and publication difficult. The extensive data storage requirements for high-quality cameras and sensors are a challenge for establishing a precision livestock farming system [46]. Furthermore, installation in harsh environments can lead to hardware degradation and sensor damage, especially in remote rural areas, making it inconvenient for personnel to maintain the devices [44], while skilled farming staff are required to operate high-tech devices or systems. Regular maintenance and calibration of cameras are essential to sustain optimal performance and ensure reliable data for informed decision-making [47,48]. Understanding and mitigating the impact of these factors is essential for unlocking the benefits of RGB imaging in pig farm operations.

Data acquisition and processing algorithm

Data acquisition and processing algorithms for RGB imaging in pig farms are essential components for effective monitoring and management. In data acquisition, high-resolution RGB cameras are strategically positioned throughout the farm to capture real-time images of the pigs and their surroundings [34]. These cameras may be mounted on poles, walls, or other structures to provide comprehensive coverage. Optimizing data acquisition involves considering lighting, camera placement, and environmental factors like dust and humidity to ensure clear and consistent image capture [49]. Once the images are acquired, sophisticated processing algorithms are used to extract valuable insights from the RGB data. These algorithms typically involve several steps, including image segmentation, feature extraction, and analysis [33]. Fig. 4 shows a schematic of RGB image pre-processing, feature extraction, segmentation, and classification techniques for pig image data analysis. Image segmentation divides the images into meaningful regions—such as individual pigs or different areas of the farm—using techniques like thresholding or clustering [50]. Feature extraction then identifies key characteristics within these regions, such as pig count, size, or behavior [33]. The extracted features are analyzed to provide insights for farm management. Image processing algorithms can track the movement patterns of pigs, detect signs of distress or illness, or assess feeding behavior and activity levels [51].

jast-67-1-17-g4
Fig. 4. A schematic representation of image pre-processing, feature extraction, segmentation, and classification techniques used for the analysis of data in the context of RGB images.
Download Original Figure

Video denoising is the process of removing noise from a video stream to improve visual clarity; it is applied to each frame through spatial, temporal, or spatio-temporal methods [52]. Noise reduction is crucial in video processing as noise distorts images and impacts the effectiveness of subsequent processing steps. Many noise reduction techniques that were originally developed for color image processing have been successfully adapted for video applications [53]. Machine learning techniques, such as deep learning, may be applied to improve the accuracy and efficiency of these analyses by training algorithms on large datasets of annotated images [54]. Throughout the data acquisition and processing pipeline, quality control measures are implemented to ensure the accuracy and reliability of the results. This may involve regular calibration of cameras, validation of algorithm performance against ground truth data, and ongoing refinement of processing techniques based on feedback from farm operators [55]. The integration of advanced data acquisition and processing algorithms for RGB imaging enables pig farms to gain valuable insights into animal behavior, health, and welfare, ultimately supporting more informed decision-making and optimizing farm productivity.

APPLICATIONS OF RGB IMAGING FOR PIG DISEASE AND HEALTH MANAGEMENT

RGB imaging holds significant promise in the field of pig disease and health management. It enables non-invasive monitoring of pig health through various applications. It facilitates the detection of skin conditions, respiratory problems, and lameness by analyzing visual cues on the body. For vulnerable piglets, RGB imaging helps to identify signs of distress or injury, promoting quick action to prevent crushing. Moreover, RGB technology enables tracking of individual pigs, body condition scoring, and behavioral analysis, supporting precision livestock farming practices. This non-invasive and cost-effective approach allows for early disease detection, data-driven decision-making, and overall improvements in pig health and welfare. Table 2 shows the overall usage of RGB imaging to enhance the early detection, prevention, and management of diseases and sickness in pig farming.

Table 2. Summary of RGB imaging techniques used to improve health monitoring and management practices in pig farming
Application Description Benefits
Disease symptom detection RGB imaging detects visual symptoms such as skin lesions, abnormal breathing, and discoloration. Enables early identification of diseases such as respiratory issues, skin infections, and injuries.
Tracking disease progression Continuous imaging tracks changes in symptoms over time, helping monitor recovery or deterioration. Assists in evaluating the effectiveness of treatments and adjusting interventions accordingly.
Behavior and activity monitoring Monitors activity levels, locomotion patterns, and behavioral changes (e.g., tail biting, lameness). Identifies signs of stress, aggression, or health-related issues, improving welfare and reducing injury risks.
Body weight & condition monitoring Estimates body weight, fat distribution, and overall condition by analyzing body size, shape, and dimensions. Reduces the need for manual weighing, allows real-time tracking of growth and ensure optimal feeding strategies.
Download Excel Table
Early detection and tracking of disease symptoms

Disease detection is crucial for timely intervention to increase treatment success and reduce negative impacts on pig welfare. It helps to mitigate the spread of illness, reduces mortality rates, and safeguards both animal and human health. In 2018, several countries—including China, Vietnam, Korea, and Laos—experienced significant outbreaks of swine flu, leading to the culling of millions of pigs [56]. This devastating event underscored the critical importance of effective disease monitoring and early detection measures.

While traditional epidemiological models like susceptible, infectious, and recovered (SIR) and susceptible, exposed, infectious, and recovered (SEIR) are effective for short-term outbreak prediction, they struggle with complex dynamics and early detection [57]. Furthermore, conventional disease monitoring methods often involve frequent testing of genetic materials, which can be impractical, time-consuming, and costly [34]. As an alternative, correlating physical indicators provides a viable solution for ongoing surveillance. By observing and analyzing physiological markers (e.g., temperature, respiratory rate, and behavior patterns), farmers can achieve early detection of potential health issues, enabling prompt intervention and treatment [8,58]. Moreover, non-invasive data collection methods offer a safe approach for both humans and animals. Minimizing direct contact between humans and potentially infected animals reduces the risk of disease transmission between species.

Therefore, implementing RGB image-based and machine-learning techniques for non-invasive disease detection in pig farms is a promising approach [54,59,60]. By utilizing RGB cameras or imaging devices installed within the farm environment, continuous monitoring of the physical characteristics, behaviors, and activity of pigs can be achieved to diagnose diseases and illnesses [34,61]. Captured images can then be processed using machine learning algorithms to detect patterns indicative of potential diseases, symptoms, and other health issues. Through machine learning, algorithms can be trained to recognize subtle changes in pig behavior, posture, or appearance that may signal the presence of disease. This approach enables early detection of illnesses, allowing farmers to intervene promptly and prevent the spread of diseases within the pig farm.

Monitoring and tracking the daily activities of pigs, including their movements, eating habits, drinking patterns, and behavior, have been found to be valuable for detecting potential diseases and health issues [36]. Pigs exhibit various behaviors and activity patterns that can serve as indicators of their well-being or potential health issues [62]. By monitoring these behaviors and activities, it becomes possible to detect deviations from normal behavior that may signify underlying health problems [62]. For instance, changes in feeding behavior (e.g., reduced appetite or increased feeding frequency) can be indicative of digestive issues or metabolic disorders [63]. Similarly, alterations in locomotion patterns (e.g., lameness or reluctance to move) may signal musculoskeletal problems or infectious diseases like foot and mouth disease [64]. Additionally, monitoring resting behaviors (e.g., prolonged lying down or restlessness) can help to identify pain, discomfort, or respiratory distress [65]. Integrating RGB imaging with behavioral observations enables automated monitoring of pigs, offering real-time data for early disease detection and health assessment. Advanced image processing and machine learning models can identify disease indicators, facilitating timely veterinary intervention and improved management practices.

Zhu et al. [66] experimented with a novel approach combining wireless technology and image processing to predict the probability of pig illness. Their approach integrated monitoring equipment with USB cameras and an advanced moving object detection algorithm, which was bolstered by background reduction techniques. Their setup facilitated real-time image capture and swift transmission of alarm images and pig locations upon anomaly detection. However, the effectiveness of detection might vary based on factors like pig population size and camera placement relative to their movement zones. Weixing and Zhilei [67] introduced a real-time monitoring system for tracking pig breathing using image-based methods, which captured RGB images and utilized Concave–Convex recognition to locate key points along the ventral lines of pigs. Using enhanced chain coding, they then calculated the length of the line connecting these points, enabling respiratory rate estimation. Their study reported a 6.05% relative error compared to manual observation, offering a non-invasive and accurate means for real-time monitoring of pig breathing, which is crucial for pig welfare and health management. A machine vision-based method was developed in another study [68] to measure respiration rate in group-housed pigs. The method utilized an oriented object detector to select the region of interest and analyzed time-varying features to extract the respiration rate. Testing on videos of group-housed pigs using an RGB camera showed a correlation coefficient of 0.92 for pigs wearing belts and 0.95 for controls. However, movement may disrupt signal accuracy, limiting its applicability to resting pigs.

Chung et al. [69] introduced an automated method for monitoring the daily activities of group-housed pigs using RGB video data, focusing on their circadian rhythm under varying light conditions. Their system used a cost-effective video sensor with a resolution of 1280 × 720 pixels and a frame rate of 30 fps, along with a server. Experimentation on data from two pig farms demonstrated the effectiveness of the Gaussian Mixture Model in detecting management issues within group-housed pig environments. In a different study [70], a smart system was developed to monitor body temperature and motion in real time for early infectious disease detection. The system utilized biosensors and accelerometers in ear tags alongside continuous video monitoring. In a study involving 10 pigs infected with African swine fever (ASF), the system detected infection onset (indicated by elevated body temperature and decreased movement) before or simultaneously with other indicators. Video analysis identified reduced movement effectively, offering a cost-effective alternative to direct motion measurement. The system provided alerts to the owner following changes in body temperature or movement, potentially reducing the need for periodic sampling and enhancing the early detection of infections in farms, which in turn could help mitigate economic losses and logistical challenges in pig farming. Several image processing methods have been applied to the RGB images collected under pig farm conditions to analyze pig activity and disease conditions, as illustrated in Fig. 5.

jast-67-1-17-g5
Fig. 5. Various image processing techniques applied to RGB images captured in pig farm environments. (A) Image binarization, (B) background segmentation, (C) image masking, (D) thresholding of pig image, (E) masking and cropping, (F) color space conversions (RGB, HSV, LAB, YCbCr, xyz, and YUV) for feature extraction, (G) Otsu segmentation, (H) histogram equalization, and (I) pig body skeleton analysis.
Download Original Figure

Jorquera-Chavez et al. [5] investigated the remote monitoring of pigs for early symptoms of respiratory disease using FLIR Duo Pro R cameras, which integrate high-resolution radiometric thermal and 4K visible RGB sensors. Custom MATLAB algorithms processed images, focusing on the eye area for infrared thermography and remote heart rate measurement. Two algorithms assessed heart rate: one tracking spatial patterns in the eye area and the other using photoplethysmography principles. Remote heart and respiration rates correlated positively with standard measures (r = 0.61–0.66). Overhead cameras detected physiological changes before clinical signs appeared, with differences in eye temperature and heart rate evident two days prior to clinical symptoms and significant respiration rate changes occurring the day before.

Fernández-Carrión et al. [71] proposed a system to monitor pig activity and detect ASF infection using RGB video and data processing techniques. Video recordings at 6 fps with a resolution of 704 × 576 pixels in RGB24 format were analyzed, focusing on the red channel for optimal contrast. Animal movements were tracked using the Optical Flow algorithm based on the Horn-Schunck methodology, implemented within MATLAB. Motion smoothing was achieved through a simple moving average filter, and changes indicative of infection onset were identified using the k-means algorithm coupled with the gap criterion algorithm. A gradual decline in pig mobility, statistically significant at the 95% confidence level, was observed four days post-infection, with a 10% decrease in daily motion even before clinical signs appeared. The study recommended using high-definition cameras for improved data quality and accuracy; HD cameras improve data quality and accuracy by automatically adjusting contrast and brightness, reducing background noise and blurring. These findings highlight the potential of machine vision for continuous monitoring and early illness detection in commercial pigs.

Monitoring behavior and activity for disease prevention

Kashiha et al. [72] explored the feasibility of automating the detection of marked pigs within a pen for experimental and behavioral research purposes using image processing techniques. The videos were captured in MPEG-1 format, with a resolution of 720 × 576 pixels and a frame rate of 25 fps. Image segmentation isolated pig areas, addressing lighting effects through histogram equalization and binarization. Binarization involved 2-D Gaussian low-pass filtering and Otsu’s method for global thresholding, followed by morphological closing. Ellipse fitting located pigs accurately, and pattern recognition algorithms differentiated individuals based on unique paint patterns, achieving an 88.7% recognition rate validated by expert visual labeling. However, reliance on individual pig marking limits practicality for large-scale commercial applications, and issues like fading paint patterns, unclear patterns due to pig movements, and mark invisibility in low-light conditions pose challenges.

The lying behavior of groups of pigs was investigated [36] in commercial farm settings using image processing and Delaunay triangulation. Over 15 days, two pens with 22 growing pigs were monitored using top-view CCD cameras. Image processing algorithms were applied to isolate pigs from their background, and their x-y coordinates were utilized for ellipse fitting, enabling precise localization of each pig. Changes in lying posture and location due to temperature fluctuations were accurately detected through analysis of region properties and the Delaunay triangulation perimeter. This method holds promise for studying environmental influences on pig behavior, production efficiency, and welfare in commercial farms. Pig behavior detection was conducted using various image processing fusion methods, as shown in Fig. 6.

jast-67-1-17-g6
Fig. 6. Pig behavior detection and analysis using image processing fusion techniques. (A) Ellipse-based segmentation, (B) Delaunay triangulation on pig body, and (C) combination of ellipse and Delaunay triangulation for detecting laying patterns.
Download Original Figure

Tu et al. [73] proposed a pig detection algorithm for grey-scale video footage, focusing on foreground object segmentation. Their method comprised three stages: updating background modeling with texture information, computing pseudo-wavelet coefficients, and generating a probability map using a factor graph with a second-order neighborhood system and a loopy belief propagation (BP) algorithm. However, computational complexity arose due to factor graphs and the BP algorithm. Zhang et al. [55] proposed an effective method for detecting and tracking individual pigs in video footage, addressing challenges like variable lighting conditions, similar appearance of individual pigs, deformations, and occlusions. The approach combined a CNN-based detector with a correlation filter-based tracker and used a novel hierarchical data association algorithm. By leveraging features from multiple scales in a single-stage prediction network, the detector achieved a balance between accuracy and speed. The method defined a tag-box for each pig to extract local features for learning and conducted multiple object tracking using correlation filters. It handled tracking failures by refining detection hypotheses and correcting drifted tracks through re-initialization. Experimental results on a commercial farm dataset demonstrated the robustness of the approach, suggesting its potential for long-term individual pig monitoring in complex environments.

Ahrendt et al. [74] presented a real-time machine vision system for tracking pigs in loose-housed farms. Utilizing a camera and a personal computer, the system employed a two-step tracking algorithm. Preliminary pig segments were identified in each frame using support maps, followed by constructing a 5D-Gaussian model encompassing position and shape. Software correction for fisheye distortion enabled monitoring of a larger stable area. Developed in MATLAB and implemented in C, the system operated in real-time and demonstrated robustness in continuously tracking at least three pigs for over 8 minutes without losing track or identity. Lu et al. [75] introduced an ellipse-based segmentation algorithm for adhesive piglet images in farm conditions. Initially, ellipse fitting established parameter ranges for different age groups. Contours of connected components were then extracted and segmented using concave points. Ellipse fitting was applied to each contour segment, with additional rules proposed for ellipse merging. Experimental results in Matlab showed an accuracy exceeding 86% for piglet counts under 7. This algorithm lays the groundwork for piglet weight monitoring systems.

Various methods have been implemented to assess movement patterns in pigs. In one study, color video was used to measure 2D locomotion by overlaying multiple images of motion [76], providing insights into movement structure and patterns. Video images were captured using a Microsoft OEM Life Cam web camera mounted on the ceiling, with a height of 3.2 m. RGB images were cropped and converted to grayscale for efficiency. The Otsu method was applied for segmentation, producing binary images of pigs. Background noise was filtered out, and a motion filter isolated moving pigs. Morphological operations refined the images, and the pigs were repositioned and oriented. Head and ear positions were determined using width curves and derivatives. Stacked binary images created a movement map with a threshold of 15 frames to ensure significant movements were captured.

In contrast, Stavrakakis et al. [77] used commercial motion capture cameras arranged in an array at a distance of 3 m from the pig pens. Coupled with motion capture software, this setup enabled the precise tracking of reflective markers on pigs, facilitating accurate measurement of locomotion in 3D. For practical applications in commercial settings, a more accessible solution was proposed [78] using a single-camera system with a Microsoft Kinect V1 motion sensor, along with the Kinect developer toolkit and algorithm for 3D lameness measurement. Kulikov et al. [79] also used a single camera to measure the height of pigs, particularly when lying down, demonstrating the versatility of camera-based approaches in assessing various aspects of pig behavior and locomotion.

Estimating body weight and condition for health optimization

RGB cameras have become widely adopted in machine vision due to their cost-effectiveness and efficiency. Researchers have extensively explored various algorithms aimed at extracting livestock body dimensions from 2D images using these cameras. Wu et al. [80] developed a 3D reconstruction system comprising six cameras recording RGB images, using stereovision techniques to achieve 3D reconstruction of pigs. Similarly, Pezzuolo et al. [81] introduced a structure from motion (SfM) photogrammetric approach for 3D reconstruction; their study proposed an analysis of pig body 3D SfM characterization across various conditions, including different numbers of camera poses and animal movements. The assessment utilized the total reconstructed surface as a reference index to quantify the quality of 3D reconstruction; the results demonstrated the potential to characterize up to 80% of the total animal area with this method. Fig. 7 shows the 3D reconstructed pig point cloud from pig body weight and movement analysis using RGB images.

jast-67-1-17-g7
Fig. 7. Detailed representation of 3D reconstruction of pig point cloud from RGB images for body weight and movement analysis.
Download Original Figure

However, RGB-based reconstruction methods face significant limitations due to the absence of a third dimension, potential distortions, the necessity for calibration procedures, and the requirement for multiple cameras. Consequently, their effectiveness has been greatly constrained. A summary of pig disease detection and tracking using RGB imaging and image processing algorithms is provided in Table 3.

Table 3. Overview of techniques and algorithms used for identifying and tracking pig diseases with RGB imaging
Camera type Detection type Method / algorithm Accuracy Reference
DH-SD1A203T-GN Diseases, tracking Object detector+ time-varying features 92.0 [68]
- Enhanced moving object detection - [66]
- Concave-Convex recognition technique 93.9 [67]
- Gaussian mixture model (GMM) 92–96 [69]
Panasonic WV-BP330 Histogram equalization and binarization 88.7 [72]
- Optical flow and k-means algorithms 95 [71]
FLIR DuoPro R Pattern recognition and photoplethysmography (PPG) 66 [5]
Kinect depth camera filter-based tracker and hierarchical algorithm 89.5 [55]
VIVOTEK & Hikvision Behavior, activity Ellipse fitting, Delaunay triangulation 82 [36]
Monacor TVCCD-140IR Loopy belief propagation (BP) algorithm 93.3 [73]
Elphel NC353L Segmentation and 5D-Gaussian model - [74]
Nikon D90 Ellipse-based segmentation algorithm 86 [75]
Microsoft OEM Life Cam Otsu method, binarization, morphological operation - [76]
Kodak DCS760 Body weight Structure from motion (SfM) [80]
Nikon D5100 Structure from motion (SfM) 80 [81]
Download Excel Table
Integrating deep learning and RGB Imaging techniques for enhanced detection and monitoring

Detection and tracking of pig diseases through machine learning and RGB imaging represent a promising advancement in livestock farming. Machine learning is a branch of AI that focuses on the development of algorithms and statistical models that enable computers to learn and improve from experience without being explicitly programmed [82]. By utilizing the capabilities of machine learning algorithms and RGB imaging technology, farm owners can accurately identify and monitor various pig diseases. RGB imaging-based monitoring of livestock struggles with noise and data overload from light source variations and image resolution differences. However, studies have shown that machine learning can mitigate noise and manage large datasets, improving the accuracy and efficiency of livestock monitoring [36]. Commonly used machine learning techniques for analyzing RGB image data in pig monitoring include linear discriminant analysis, artificial neural networks, and SVMs. However, deep learning—which is a growing field within machine learning, with its deeper architecture and superior learning capabilities (particularly through CNNs)—has gained growing recognition over recent years [83]. Pig diseases, behavior detection, and tracking have been analyzed using various machine learning algorithms, as illustrated in Fig. 8.

jast-67-1-17-g8
Fig. 8. Monitoring, detection, and tracking of pig diseases and behavior using machine learning applications in pig farms. (A) Posture detection and segmentation, (B) detection and tracking, (C) recognition of different body parts, (D) detection of disease conditions, and (E) tracking and counting in farm settings using RGB image data.
Download Original Figure

Deep learning has been applied to detect and recognize pig behaviors in farm conditions across various imaging systems. For instance, Zheng et al. [84] proposed a detection system for pig postures utilizing a Kinect v2 sensor and the Faster R–CNN technique with a region proposal network and Zeiler and Fergus Net (ZFnet). Using RGB and depth images captured by the camera, a program was developed to identify sow postures and locations in bounding boxes. Testing on a dataset acquired at 5 fps yielded a detection accuracy of 87.1%. The study authors acknowledged that RGB image-based identification was affected by color and illumination variations from factors like heat lamps and day-night cycles. Automatic detection from depth images can overcome such disturbances.

Tu et al. [85] introduced PigMS R–CNN, a framework based on mask scoring R–CNN (MS R–CNN) for segmenting adhesive pig areas in images of pig groups for identification and localization. A 101-layer residual network with the feature pyramid network served as the feature extraction network. The PigMS R–CNN head network included three branches for regression, classification, and segmentation, enabling extraction of location, classification, and segmentation information for detected pigs. Results showed an F1 score of 0.9228 with traditional NMS, improving to 0.9374 with a soft-NMS threshold of 0.7. Ju et al. [86] addressed the segmentation of touching pigs in crowded environments using low-contrast images from a Kinect sensor capturing both depth and RGB images at 512 × 424 pixels resolution and 30 fps. Initially, the you only look once (YOLO) technique, a rapid CNN-based object detection method, was used for segmentation challenges. Additionally, possible boundary lines between the touching pigs were identified by analyzing their shape. Results demonstrated effectiveness in separating touching pigs in real time with 91.96% accuracy, despite the low-contrast images. However, the model could only segment two touching pigs, suggesting room for potential future improvement, particularly with the integration of transfer learning into the YOLO processing module.

Faster R–CNN and YOLO were introduced in a different study [87] for the automatic detection of pig postures and drinking behaviors in group-housed pigs on commercial farms. A Munkres variant of the Hungarian assignment algorithm was applied to maintain pig identity across consecutive frames. A Kalman filter was utilized to locate missing tracks and associated pig IDs, which were then used to create individual pig profiles. Utilizing a custom data acquisition system, a Microsoft Kinect RGB camera recorded videos of the pen floor and behavior at 25 fps with a resolution of 640 × 360 pixels. The system accurately detected behavior changes during routine management, achieving a mean average precision of 0.989 for individual behavior identification across various conditions, including disruptions in feeding.

Yang et al. [88] proposed a deep learning technique to automatically recognize nursing behaviors in sows from 2D images. They recorded top-view color videos of sows with piglets using a commercial camera, with a capture rate of 5 fps and 960 × 540 pixels resolution. Sows were segmented using a fully convolutional network (FCN) model with a Visual Geometry Group network having 16 layers (VGG16). Temporal features from the training set were then fed into an SVM binary classifier with a linear function kernel. Parameters of an additional sigmoid function were trained to map the SVM outputs into probabilities. The method achieved an accuracy rate of 97.6%, with 90.9% sensitivity and 99.2% specificity. However, challenges were observed in extremely uneven light conditions, low light, and persistent massage, affecting real-world applications. In another study, Yang et al. [89] also addressed sow image segmentation from different backgrounds in top-view 2D images using an FCN based on the VGG16, achieving an accuracy of 96.4%. The study indicated the potential of deep learning for accurately segmenting pigs from diverse background conditions.

Mazhar et al. [90] explored the application of machine learning techniques in precision pig farming. They applied a Random Forest (RF) algorithm in the Boruta package for image analysis and a neural network with a K-Nearest Neighbor algorithm for predictive big data analysis. The study demonstrated the effectiveness of these methods in enhancing precision farming practices, enabling accurate analysis of images and predictive analysis of large datasets. Cowton et al. [91] combined a deep CNN object localization method, Faster R–CNN, with the real-time, multi-object tracking method Deep SORT to create a system that autonomously localized and tracked individual pigs. This system enabled the extraction of metrics related to individual pig behaviors from RGB sensors within the Microsoft Kinect v2. Pigs could be localized with an accuracy of 90.1% and tracked individually across video footage with an accuracy of 92%.

Monitoring body weight is crucial for the early detection and management of various diseases in pig farming. Changes in body weight can offer valuable insights into potential health issues and aid in disease detection. For example, sudden weight loss may signal the presence of diseases such as swine fever, respiratory infections, or digestive disorders, while obesity can increase the risk of conditions like arthritis, heart disease, and metabolic disorders. Kárpinszky and Dobsinszki [92] developed an RGB-based system to estimate daily pig weights, eliminating the need for stressful weighing procedures. Tested on a commercial farm with 32 pigs over 100 days, the system identified key pig features (e.g., head, shoulder, belly, and rump) using Mask R–CNN, Pretty Contour Picker’s, and Multi-Layer Perceptron models. Achieving a rate of 97.4% accuracy compared to manual records, the system introduced a convenient web interface for pig management and monitoring, aiding informed decision-making in farming operations. Further testing across various pig facilities with diverse camera setups, feeders, and lighting conditions, particularly in low-light environments.

Paudel et al. [93] compared the prediction of pig weight using a weight-to-volume correlation and a PointNet-based 3D deep learning model. An Intel Real-Sense camera was used to capture 3D images and point cloud data from pigs in a holding pen, which underwent pre-processing to remove background scenes before input into the deep learning architecture for training and testing. Despite noisy training data, the deep learning model exceeded volume correlation with 94.2% accuracy on unseen point clouds, even for larger pig sizes. The model accurately detected individual pig weights and had the potential to predict the weights of multiple pigs simultaneously, addressing challenges such as free movement and adverse conditions. Wang et al. [94] introduced a rapid estimation technique of pig body size using a YOLOv5 model with MobilenetV3 integration and incorporating a lightweight object detection network as the feature extraction network, along with an attention mechanism. A depth camera captured the pig’s backside information at a fixed height, enabling calculation of the body height. A gradient-boosting regression algorithm established the body size prediction model based on the Euclidean distance between these key measurement points and actual body size data. The result demonstrated an accuracy of 98% for the body size estimation using the model. Other studies have also demonstrated pig body weight estimation using RGB imaging. A summary of pig disease detection and tracking using RGB imaging and machine learning algorithms is presented in Table 4.

Table 4. Summary of pig disease detection and tracking using RGB imaging and machine learning algorithms
Camera type Detection type Method / algorithm Accuracy Reference
FL3-U3-88S2C-C Diseases, posture, and tracking PigMS R–CNN 93.0 [85]
Kinect v2 Faster R–CNN 87.1 [84]
Kinect v2 YOLO 91.96 [86]
Kinect RGB Faster R–CNN, YOLO 98.9 [87]
DS-2CD1321D-I FCN+VGG16 97.6 [88]
DS-2CD1321D-I FCN+VGG16 96.4 [89]
IFM O3D313 Locomotion RF + KNN [90]
Kinect v2 Faster R–CNN+ Deep SORT 90.1 [91]
Dahua IPC-HFW1230S-S4 Body weight Mask R–CNN, PCP, MLP 97.4 [92]
Intel Real Sense D435 PointNet 94.2 [93]
Basler TOF 640 YOLOv5 + MobilenetV3 97.8 [94]
Kinect camera Structure from motion (SfM) [81]
Kinect camera CNN [84]

CNN, convolutional neural network; YOLO, you only look once; FCN, fully convolutional network; VGG16, Visual Geometry Group Network having 16 layers.

Download Excel Table

Furthermore, machine learning algorithms can be continuously refined and improved as more data are collected, leading to more accurate and reliable disease detection systems over time. Overall, the integration of image-based technology with machine learning holds great promise for non-invasive disease detection in pig farms, ultimately contributing to improvements in animal welfare and farm productivity.

In commercial pig farming, RGB sensors enhance management practices by enabling real-time behavior monitoring, feeding management, environmental regulation, and health surveillance. These sensors track pig activity and food consumption and monitor environmental conditions (e.g., temperature and humidity) to ensure optimal living environments. Additionally, RGB sensors assist in detecting illness or injury through machine vision algorithms. Table 5 highlights various commercial products used for behavior monitoring, disease detection, and body weight measurement in pig farming.

Table 5. Overview of commercially available RGB image sensor-based systems designed to support health monitoring, disease detection, and farm management for pig healthcare
Measure System name System type Monitoring performance Website
Behavior, diseases, activity Pig Guard Handheld Yes https://www.serket-tech.com/
Mounted No https://www.hikvision.com/en/
Handheld Yes https://www-en.yingzi.com/index.html
EdgeFarm Mounted No https://intflow.ai/en/home/
Body weight Handheld No https://lembergsolutions.com/
Viiew, Viiew Pro Handheld Yes https://illuvation.kr/_eng
PigVision Mounted Yes https://asimetrix.co/en/
optiSCAN Handheld No https://www.hl-agrar.de/cms/en/Home.html
Pigxcel Mounted Yes https://www.smartagritech.se/?lang=en
eYeGrow Mounted Yes https://www.fancom.com
WUGGL Handheld No http://www.wuggl.com
Download Excel Table

Pig Guard (Serket, Amsterdam, the Netherlands) is an AI-powered livestock management software that uses camera vision to monitor pig behavior, detect early signs of illness, and manage feeding and treatment. In partnership with Hikvision (China), it tracks movements, feeding, and aggression in real time, offering alerts to improve herd health and farm management. Yingzi Technology (Guangzhou, China) developed a pig facial recognition system with 98% accuracy, using deep learning algorithms to update profiles with details like individual identity, breed, weight, and gender. EdgeFarm (Intflow, Gwangju, Korea) provides an AI solution that monitors biometric data to detect injuries and diseases while tracking eating habits, social interactions, and weight gain. Lemberg Solutions (Lviv Oblast, Ukraine) developed an AI-based image recognition system for automatic pig weight measurement, reducing stress and improving efficiency. Viiew and Viiew Pro (Illuvation, Jeonju, Korea) offer AI-integrated docking systems for accurate weight management. PigVision (Asimetrix, North Carolina, USA) uses compact cameras with AI to estimate pig weights, while optiSCAN (Holscher & Leuschner, Emsbüren, Germany) employs a 3D camera and AI to provide precise measurements from over two million data points. Pigxcel Edge (Smart Agriculture Solution, Sjövik, Sweden) uses machine learning to track daily pig weights, with data analyzed in the cloud. The eYeGrow monitor (Fancom BV, Panningen, The Netherlands) automates weight monitoring with a 3D camera, and WUGGL One (WUGGL GmbH, Lebring, Austria) combines high-precision cameras with a contactless temperature sensor for real-time monitoring.

RGB sensors, combined with AI technology, present a promising approach for pig farms to enhance animal welfare, improve farm management, and boost profitability in commercial applications. As AI and sensor technology continue to evolve, their potential applications in pig farming are expected to expand, driving further innovation and improvements across the industry. These advances will enable more precise monitoring, automated decision-making, and optimized resource management, contributing to the future of smart farming.

FUTURE PERSPECTIVES, CHALLENGES AND SUMMARY

Machine vision and RGB imaging provide significant advantages in pig health management by enabling early disease detection and real-time monitoring of behavior, surpassing traditional observation-based methods. These technologies analyze large datasets to detect subtle changes in behavior or appearance that indicate disease onset, enhancing welfare monitoring by tracking social interactions and stress indicators [95]. The integration of sensor and camera data offers a comprehensive view of the farm environment, aiding in the effective management of housing conditions. Cameras are widely used for disease detection, behavior monitoring, and health assessment in controlled environments, with notable benefits for farm monitoring [34,44].

However, several challenges hinder the full potential of machine vision in pig health management. A primary issue is the need for robust, accurate image processing algorithms that are capable of handling broad variability in pig appearance and behavior. Developing machine learning models that are trained on large, labeled datasets is both resource-intensive and time-consuming [45]. Commercial farm settings present additional obstacles, such as the clustering of animals, varied feeding habits, unmarked animals, inconsistent lighting, environmental debris, and background interference [6,44]. Surveillance systems also face challenges such as abrupt lighting changes that cause shadows, similar pig features that complicate the identification of individuals, and occlusions from group interactions or debris [55,96]. Object deformation and temporary obstructions further complicate tracking and identification processes [6,59,97].

Implementing machine vision and RGB imaging in pig farms is complex due to the diversity of sensors and data systems already in use. Additionally, privacy and ethical concerns surrounding data usage and regulatory compliance must be carefully addressed when integrating these technologies. Despite these challenges, machine vision holds substantial promise for advancing health management in modern pig farming systems. Continued research and development efforts are essential to further refine image acquisition techniques, enhance the accuracy of algorithms, and address privacy and ethical considerations surrounding data usage. The immersive adoption of these technologies—alongside complementary advances in sensor technology, drones, and robotics—promises to revolutionize pig farming practices. By exploring the insights provided by machine vision and RGB imaging, farmers can optimize disease management strategies, improve pig welfare, and ultimately enhance the sustainability and profitability of pig production systems.

Competing interests

No potential conflict of interest relevant to this article was reported.

Funding sources

This work was supported by the Korea Institute of Planning and Evaluation for Technology in Food, Agriculture and Forestry (IPET) and Korea Smart Farm R&D Foundation (KosFarm), through Smart Farm Innovation Technology Development Program, funded by Ministry of Agriculture, Food and Rural Affairs (MAFRA) and Ministry of Science and ICT (MSIT), Rural Development Administration (RDA) (Project No. 421044-04), Korea.

Acknowledgements

Not applicable.

Availability of data and material

Upon reasonable request, the datasets of this study can be available from the corresponding author.

Authors’ contributions

Conceptualization: Reza MN, Chung SO.

Data curation: Lee KH, Habineza E, Samsuzzaman, Kyoung H, Choi YK.

Formal analysis: Reza MN, Lee KH, Habineza E, Samsuzzaman, Kyoung H, Choi YK.

Methodology: Reza MN, Kim G, Chung SO.

Software: Samsuzzaman, Kyoung H, Choi YK, Kim G.

Validation: Lee KH, Habineza E, Samsuzzaman, Kyoung H, Choi YK, Kim G, Chung SO.

Investigation: Kim G, Chung SO.

Writing - original draft: Reza MN.

Writing - review & editing: Reza MN, Lee KH, Habineza E, Samsuzzaman, Kyoung H, Choi YK, Kim G, Chung SO.

Ethics approval and consent to participate

This article does not require IRB/IACUC approval because there are no human and animal participants.

REFERENCES

1.

Rauw WM, Rydhmer L, Kyriazakis I, Øverland M, Gilbert H, Dekkers JCM, et al. Prospects for sustainability of pig production in relation to climate change and novel feed resources. J Sci Food Agric. 2020; 100:3575-86

2.

Govoni C, Chiarelli DD, Luciano A, Pinotti L, Rulli MC. Global assessment of land and water resource demand for pork supply. Environ Res Lett. 2022; 17:074003

3.

Vida V, Szűcs I. Pork production and consumption issues from the perspective of the religion and the World’s growing population. Appl Stud Agribus Commer. 2020; 14:121-8

4.

Yang CH, Ko HL, Salazar LC, Llonch L, Manteca X, Camerlink I, et al. Pre-weaning environmental enrichment increases piglets’ object play behaviour on a large scale commercial pig farm. Appl Anim Behav Sci. 2018; 202:7-12

5.

Jorquera-Chavez M, Fuentes S, Dunshea FR, Warner RD, Poblete T, Unnithan RR, et al. Using imagery and computer vision as remote monitoring methods for early detection of respiratory disease in pigs. Comput Electron Agric. 2021; 187:106283

6.

Habineza E, Reza MN, Chowdhury M, Kiraga S, Chung SO, Hong SJ. Pig diseases and crush monitoring visual symptoms detection using engineering approaches: a review. Precis Agric Sci Technol. 2021; 3:159-73

7.

Delsart M, Pol F, Dufour B, Rose N, Fablet C. Pig farming in alternative systems: strengths and challenges in terms of animal welfare, biosecurity, animal health and pork safety. Agriculture. 2020; 10:261

8.

Neethirajan S. Transforming the adaptation physiology of farm animals through sensors. Animals. 2020; 10:1512

9.

Handa D, Peschel JM. A review of monitoring techniques for livestock respiration and sounds. Front Anim Sci. 2022; 3:904834

10.

Sejian V, Shashank CG, Silpa MV, Madhusoodan AP, Devaraj C, Koenig S. Non-invasive methods of quantifying heat stress response in farm animals with special reference to dairy cattle. Atmosphere. 2022; 13:1642

11.

Reza MN, Ali MR, Samsuzzaman , Kabir MSN, Karim MR, Ahmed S, et al. Thermal imaging and computer vision technologies for the enhancement of pig husbandry: a review. J Anim Sci Technol. 2024; 66:31-56

12.

Ma W, Sun Y, Qi X, Xue X, Chang K, Xu Z, et al. Computer-vision-based sensing technologies for livestock body dimension measurement: a survey. Sensors. 2024; 24:1504

13.

Petrovic B, Tunguz V, Bartos P. Application of computer vision in livestock and crop production—a review. Comput Artif Intell. 2023; 1:360

14.

Manakitsa N, Maraslidis GS, Moysis L, Fragulis GF. A review of machine learning and deep learning for object detection, semantic segmentation, and human action recognition in machine and robotic vision. Technologies. 2024; 12:15

15.

Chen Z, Lu J, Wang H. A review of posture detection methods for pigs using deep learning. Appl Sci. 2023; 13:6997

16.

Petso T, Jamisola RS, Mpoeleng D, Bennitt E, Mmereki W. Automatic animal identification from drone camera based on point pattern analysis of herd behaviour. Ecol Inform. 2021; 66:101485

17.

Ghosh P, Mandal SN. PigB: intelligent pig breeds classification using supervised machine learning algorithms. Int J Artif Intell Soft Comput. 2022; 7:242-66

18.

Zhou Z. Detection and counting method of pigs based on YOLOV5_Plus: a combination of Yolov5 and attention mechanism. Math Probl Eng. 2022; 2022:7078670

19.

Tian M, Guo H, Chen H, Wang Q, Long C, Ma Y. Automated pig counting using deep learning. Comput Electron Agric. 2019; 163:104840

20.

Fachinger V, Bischoff R, Jedidia SB, Saalmüller A, Elbers K. The effect of vaccination against porcine circovirus type 2 in pigs suffering from porcine respiratory disease complex. Vaccine. 2008; 26:1488-99

21.

Haimi-Hakala M, Hälli O, Laurila T, Raunio-Saarnisto M, Nokireki T, Laine T, et al. Etiology of acute respiratory disease in fattening pigs in Finland. Porcine Health Manag. 2017; 3:19

22.

Ardiaca García M, Montesinos-Barceló A, Bonvehí Nadeu C, Jekl V. Respiratory diseases in guinea pigs, chinchillas and degus. Vet Clin North Am Exot Anim Pract. 2021; 24:419-57

23.

Boyle LA, Edwards SA, Bolhuis JE, Pol F, Šemrov MZ, Schütze S, et al. The evidence for a causal link between disease and damaging behavior in pigs. Front Vet Sci. 2022; 8:771682

24.

Blirup-Plum SA, Jensen HE, Nielsen SS, Pankoke K, Hansen MS, Pedersen KS, et al. Gastro-intestinal lesions are not relatable to diarrhoea or specific pathogens in post-weaning diarrhoea (PWD) in pigs. Acta Vet Scand. 2023; 65:30

25.

René R, Sebastian V, Marlies D, Lukas S, Annemarie K, Andrea L. Risk factors associated with post-weaning diarrhoea in Austrian piglet-producing farms. Porcine Health Manag. 2023; 9:20

26.

Adeleye OO. Enhancing piglet survival and welfare in different farrowing systems [Ph.D. dissertation]. Newcastle upon Tyne. UK: Newcastle University. 2012

27.

Sadeghi E, Kappers C, Chiumento A, Derks M, Havinga P. Improving piglets health and well-being: a review of piglets health indicators and related sensing technologies. Smart Agric Technol. 2023; 5:100246

28.

Baxter EM, Edwards SA. Piglet mortality and morbidity: inevitable or unacceptable?.In: In: Špinka M, editor.editor. Advances in pig welfare. Duxford: Woodhead. 2018; p. p. 73-100

29.

Melišová M, Illmann G, Chaloupková H, Bozděchová B. Sow postural changes, responsiveness to piglet screams, and their impact on piglet mortality in pens and crates. J Anim Sci. 2014; 92:3064-72

30.

Stenberg H, Jacobson M, Malmberg M. A review of congenital tremor type A-II in piglets. Anim Health Res Rev. 2020; 21:84-8

31.

Hakansson F, Bolhuis JE. Tail-biting behaviour pre-weaning: association between other pig-directed and general behaviour in piglets. Appl Anim Behav Sci. 2021; 241:105385

32.

Madson DM, Arruda PHE, Arruda BL. Nervous and locomotor system. Dis Swine. 2019; 339:72

33.

Fernandes AFA, Dórea JRR, Rosa GJM. Image analysis and computer vision applications in animal sciences: an overview. Front Vet Sci. 2020; 7:551269

34.

Arulmozhi E, Bhujel A, Moon BE, Kim HT. The application of cameras in precision pig farming: an overview for swine-keeping professionals. Animals. 2021; 11:2343

35.

Benjamin M, Yik S. Precision livestock farming in swine welfare: a review for swine practitioners. Animals. 2019; 9:133

36.

Nasirahmadi A, Edwards SA, Sturm B. Implementation of machine vision for detecting behaviour of cattle and pigs. Livest Sci. 2017; 202:25-38

37.

Larsen MLV, Wang M, Norton T. Information technologies for welfare monitoring in pigs and their relation to Welfare Quality®. Sustainability. 2021; 13:692

38.

Revathi R, Hemalatha M. An emerging trend of feature extraction method in video processing.In: The Second International Conference on Computer Science, Engineering and Applications (CCSEA-2012). 2012; Delhi, India. p. p. 69-80

39.

Chen WE, Lin YB, Chen LX. PigTalk: an AI-based IoT platform for piglet crushing mitigation. IEEE Trans Ind Inform. 2021; 17:4345-55

40.

Hossain MD, Chen D. Segmentation for object-based image analysis (OBIA): a review of algorithms and challenges from remote sensing perspective. ISPRS J Photogramm Remote Sens. 2019; 150:115-34

41.

Na MH, Cho WH, Kim SK, Na IS. The development of a weight prediction system for pigs using raspberry pi. Agriculture. 2023; 13:2027

42.

Gómez Y, Stygar AH, Boumans IJMM, Bokkers EAM, Pedersen LJ, Niemi JK, et al. A systematic review on validated precision livestock farming technologies for pig production and its potential to assess animal welfare. Front Vet Sci. 2021; 8:660565

43.

Yu H, Lee K, Morota G. Forecasting dynamic body weight of nonrestrained pigs from images using an RGB-D sensor camera. Transl Anim Sci. 2021; 5 txab006

44.

Wurtz K, Camerlink I, D’Eath RB, Fernández AP, Norton T, Steibel J, et al. Recording behaviour of indoor-housed farm animals automatically using machine vision technology: a systematic review. PLOS ONE. 2019 14e0226669

45.

Li J, Green-Miller AR, Hu X, Lucic A, Mahesh Mohan MR, Dilger RN, et al. Barriers to computer vision applications in pig production facilities. Comput Electron Agric. 2022; 200:107227

46.

Wang S, Jiang H, Qiao Y, Jiang S, Lin H, Sun Q. The research progress of vision-based artificial intelligence in smart pig farming. Sensors. 2022; 22:6541

47.

Mahfuz S, Mun HS, Dilawar MA, Yang CJ. Applications of smart technology as a sustainable strategy in modern swine farming. Sustainability. 2022; 14:2607

48.

Halachmi I, Guarino M, Bewley J, Pastell M. Smart animal agriculture: application of real-time sensors to improve animal well-being and production. Annu Rev Anim Biosci. 2019; 7:403-25

49.

Kaur R, Karmakar G, Xia F, Imran M. Deep learning: survey of environmental and camera impacts on internet of things images. Artif Intell Rev. 2023; 56:9605-38

50.

Yu Y, Wang C, Fu Q, Kou R, Huang F, Yang B, et al. Techniques and challenges of image segmentation: a review. Electronics. 2023; 12:1199

51.

Neethirajan S. Artificial intelligence and sensor technologies in dairy livestock export: charting a digital transformation. Sensors. 2023; 23:7045

52.

Xu X, Li M, Sun W, Yang MH. Learning spatial and spatio-temporal pixel aggregations for image and video denoising. IEEE Trans Image Process. 2020; 29:7153-65

53.

Fan L, Zhang F, Fan H, Zhang C. Brief review of image denoising techniques. Vis Comput Ind Biomed Art. 2019; 2:7

54.

Borges Oliveira DA, Ribeiro Pereira LG, Bresolin T, Ferreira REP, Reboucas Dorea JR. A review of deep learning algorithms for computer vision systems in livestock. Livest Sci. 2021; 253:104700

55.

Zhang L, Gray H, Ye X, Collins L, Allinson N. Automatic individual pig detection and tracking in pig farms. Sensors. 2019; 19:1188

56.

Yoo D, Kim H, Lee JY, Yoo HS. African swine fever: etiology, epidemiological status in Korea, and perspective on control. J Vet Sci. 2020 21e38

57.

Halev A, Martínez-López B, Clavijo M, Gonzalez-Crespo C, Kim J, Huang C, et al. Infection prediction in swine populations with machine learning. Sci Rep. 2023; 13:17738

58.

Nicolò A, Massaroni C, Schena E, Sacchetti M. The importance of respiratory rate monitoring: from healthcare to sport and exercise. Sensors. 2020; 20:6396

59.

Chen C, Zhu W, Norton T. Behaviour recognition of pigs and cattle: journey from computer vision to deep learning. Comput Electron Agric. 2021; 187:106255

60.

Li G, Huang Y, Chen Z, Chesser GD Jr, Purswell JL, Linhoss J, et al. Practices and applications of convolutional neural network-based computer vision systems in animal farming: a review. Sensors. 2021; 21:1492

61.

Zhang Z, Zhang H, He Y, Liu T. A Review in the automatic detection of pigs behavior with sensors. J Sens. 2022; 2022:4519539

62.

Matthews SG, Miller AL, Clapp J, Plötz T, Kyriazakis I. Early detection of health and welfare compromises through automated detection of behavioural changes in pigs. Vet J. 2016; 217:43-51

63.

Fornós M, Sanz-Fernández S, Jiménez-Moreno E, Carrión D, Gasa J, Rodríguez-Estévez V. The feeding behaviour habits of growing-finishing pigs and its effects on growth performance and carcass quality: a review. Animals. 2022; 12:1128

64.

Bos EJ, Maes D, van Riet MMJ, Millet S, Ampe B, Janssens GPJ, et al. Locomotion disorders and skin and claw lesions in gestating sows housed in dynamic versus static groups. PLOS ONE. 2016 11e0163625

65.

Lagoda ME, Marchewka J, O’Driscoll K, Boyle LA. Risk factors for chronic stress in sows housed in groups, and associated risks of prenatal stress in their offspring. Front Vet Sci. 2022; 9:883154

66.

Zhu W, Pu X, Li X, Zhu X. Automated detection of sick pigs based on machine vision.In: 2009 IEEE International Conference on Intelligent Computing and Intelligent Systems. 2009; Shanghai, China. p. p. 790-4

67.

Weixing Z, Zhilei W. Detection of porcine respiration based on machine vision.In: 2010 Third International Symposium on Knowledge Acquisition and Modeling. 2021; Wuhan, China. p. p. 398-401

68.

Wang M, Li X, Larsen MLV, Liu D, Rault JL, Norton T. A computer vision-based approach for respiration rate monitoring of group housed pigs. Comput Electron Agric. 2023; 210:107899

69.

Chung Y, Kim H, Lee H, Park D, Jeon T, Chang HH. A cost-effective pigsty monitoring system based on a video sensor. KSII Trans Internet Inf Syst. 2014; 8:1481-98

70.

Martínez-Avilés M, Fernández-Carrión E, López García-Baones JM, Sánchez-Vizcaíno JM. Early detection of infection in pigs through an online monitoring system. Transbound Emerg Dis. 2017; 64:364-73

71.

Fernández-Carrión E, Martínez-Avilés M, Ivorra B, Martínez-López B, Ramos ÁM, Sánchez-Vizcaíno JM. Motion-based video monitoring for early detection of livestock diseases: the case of African swine fever. PLOS ONE. 2017 12e0183793

72.

Kashiha M, Bahr C, Ott S, Moons CPH, Niewold TA, Ödberg FO, et al. Automatic identification of marked pigs in a pen using image pattern recognition. Comput Electron Agric. 2013; 93:111-20

73.

Tu GJ, Karstoft H, Pedersen LJ, Jørgensen E. Foreground detection using loopy belief propagation. Biosyst Eng. 2013; 116:88-96

74.

Ahrendt P, Gregersen T, Karstoft H. Development of a real-time computer vision system for tracking loose-housed pigs. Comput Electron Agric. 2011; 76:169-74

75.

Lu M, Xiong Y, Li K, Liu L, Yan L, Ding Y, et al. An automatic splitting method for the adhesive piglets’ gray scale image based on the ellipse shape feature. Comput Electron Agric. 2016; 120:53-62

76.

Kongsro J. Development of a computer vision system to monitor pig locomotion. Open J Anim Sci. 2013; 3:254-60

77.

Stavrakakis S, Guy JH, Warlow OME, Johnson GR, Edwards SA. Walking kinematics of growing pigs associated with differences in musculoskeletal conformation, subjective gait score and osteochondrosis. Livest Sci. 2014; 165:104-13

78.

Stavrakakis S, Li W, Guy JH, Morgan G, Ushaw G, Johnson GR, et al. Validity of the Microsoft Kinect sensor for assessment of normal walking patterns in pigs. Comput Electron Agric. 2015; 117:1-7

79.

Kulikov VA, Khotskin NV, Nikitin SV, Lankin VS, Kulikov AV, Trapezov OV. Application of 3-D imaging sensor for tracking minipigs in the open field test. J Neurosci Methods. 2014; 235:219-25

80.

Wu J, Tillett R, McFarlane N, Ju X, Siebert JP, Schofield P. Extracting the three-dimensional shape of live pigs using stereo photogrammetry. Comput Electron Agric. 2004; 44:203-22

81.

Pezzuolo A, Milani V, Zhu D, Guo H, Guercini S, Marinello F. On-barn pig weight estimation based on body measurements by structure-from-motion (SfM). Sensors. 2018; 18:3603

82.

Tyagi AK, Chahal P. Artificial intelligence and machine learning algorithms.In: In: editor. Research anthology on machine learning techniques, methods, and applications. Hershey, PA: IGI Global Scientific. 2022; p. p. 421-46

83.

Alzubaidi L, Zhang J, Humaidi AJ, Al-Dujaili A, Duan Y, Al-Shamma O, et al. Review of deep learning: concepts, CNN architectures, challenges, applications, future directions. J Big Data. 2021; 8:53

84.

Zheng C, Zhu X, Yang X, Wang L, Tu S, Xue Y. Automatic recognition of lactating sow postures from depth images by deep learning detector. Comput Electron Agric. 2018; 147:51-63

85.

Tu S, Yuan W, Liang Y, Wang F, Wan H. Automatic detection and segmentation for group-housed pigs based on PigMS R-CNN. Sensors. 2021; 21:3251

86.

Ju M, Choi Y, Seo J, Sa J, Lee S, Chung Y, et al. A Kinect-based segmentation of touching-pigs for real-time monitoring. Sensors. 2018; 18:1746

87.

Alameer A, Kyriazakis I, Bacardit J. Automated recognition of postures and drinking behaviour for the detection of compromised health in pigs. Sci Rep. 2020; 10:13665

88.

Yang A, Huang H, Zhu X, Yang X, Chen P, Li S, et al. Automatic recognition of sow nursing behaviour using deep learning-based segmentation and spatial and temporal features. Biosyst Eng. 2018; 175:133-45

89.

Yang A, Huang H, Zheng C, Zhu X, Yang X, Chen P, et al. High-accuracy image segmentation for lactating sows using a fully convolutional network. Biosyst Eng. 2018; 176:36-47

90.

Mazhar SAS, Suseendran G. Precision pig farming image analysis using random forest and boruta predictive big data analysis using neural network and K-nearest neighbor.In: 2021 2nd International Conference on Intelligent Engineering and Management (ICIEM). 2021; London, UK. p. p. 260-4

91.

Cowton J, Kyriazakis I, Bacardit J. Automated individual pig localisation, tracking and behaviour metric extraction using deep learning. IEEE Access. 2019; 7:108049-60

92.

Kárpinszky A, Dobsinszki G. Pig weight estimation according to RGB image analysis. Agric Sci. 2023; 20:51-60

93.

Paudel S, de Sousa RV, Sharma SR, Brown-Brandl T. Deep learning models to predict finishing pig weight using point clouds. Animals. 2024; 14:31

94.

Wang Y, Sun G, Seng X, Zheng H, Zhang H, Liu T. Deep learning method for rapidly estimating pig body size. Anim Prod Sci. 2023; 63:909-23

95.

Kim JH, Poulose A, Colaco SJ, Neethirajan S, Han DS. Enhancing animal welfare with interaction recognition: a deep dive into pig interaction using xception architecture and SSPD-PIR method. Agriculture. 2023; 13:1522

96.

Li B, Liu L, Shen M, Sun Y, Lu M. Group-housed pig detection in video surveillance of overhead views using multi-feature template matching. Biosyst Eng. 2019; 181:28-39

97.

Ariza-Sentís M, Vélez S, Martínez-Peña R, Baja H, Valente J. Object detection and tracking in precision farming: a systematic review. Comput Electron Agric. 2024; 219:108757