Next Article in Journal
Prediction of Sow Farrowing Onset Time Using Activity Time Series Extracted by Optical Flow Estimation
Previous Article in Journal
Efficiency of a Modified Ovulation Synchronization Program in the Treatment of Ovarian Cysts in Dairy Cattle
Previous Article in Special Issue
Runs of Homozygosity Preliminary Investigation in Pig Breeds
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Revealing the Hidden Social Structure of Pigs with AI-Assisted Automated Monitoring Data and Social Network Analysis

1
The Roslin Institute, University of Edinburgh, Easter Bush, Edinburgh EH25 9RG, UK
2
Animal Production Department, Faculty of Agriculture, Ain Shams University, Shubra Alkhaima, Cairo 11241, Egypt
3
PIC North America, Hendersonville, TN 37075, USA
4
Animal and Veterinary Sciences Department, Scotland’s Rural College, West Mains Road, Edinburgh EH9 3JG, UK
5
PIC, C/Pau Vila No. 22, Sant Cugat del Valles, 08174 Barcelona, Spain
6
Department of Animal Science, Iowa State University, Ames, IA 50011, USA
*
Author to whom correspondence should be addressed.
Animals 2025, 15(7), 996; https://doi.org/10.3390/ani15070996
Submission received: 28 February 2025 / Revised: 24 March 2025 / Accepted: 27 March 2025 / Published: 30 March 2025
(This article belongs to the Special Issue Genetic Improvement in Pigs)

Simple Summary

Social interactions of farm animals affect their performance, health, and welfare. In practice, however, manually recording data to study these interactions can be time-consuming and labour-intensive. Recently, automated monitoring systems integrated with artificial intelligence technologies (AI) have shown considerable promise in the detection of farm animals and their behavior. This study addresses, for the first time, the hypothesis that applying social network analysis (SNA) to AI-automated monitoring data could facilitate the analysis of animal social interactions. Data were collected through an automated monitoring system that recorded 2D-camera images and videos of pigs housed in six pens (16–19 animals each) on a PIC breeding farm (USA). The system provided real-time data, including ear-tag readings, elapsed time, posture (standing, lying), and XY-coordinates of the shoulder and rump for each pig. The SNA showed that as pigs grew, the social connections within the pig groups became more structured. However, certain pigs became more central in their network over time, reflecting the establishment of a social hierarchy within pens. This study shows that combining AI-assisted monitoring and SNA can provide novel insights into animal social interactions. These findings could help farmers better understand animal social structures, leading to improved management and breeding strategies.

Abstract

Background: The social interactions of farm animals affect their performance, health and welfare. This proof-of-concept study addresses, for the first time, the hypothesis that applying social network analysis (SNA) on AI-automated monitoring data could potentially facilitate the analysis of social structures of farm animals. Methods: Data were collected using automated recording systems that captured 2D-camera images and videos of pigs in six pens (16–19 animals each) on a PIC breeding company farm (USA). The system provided real-time data, including ear-tag readings, elapsed time, posture (standing, lying, sitting), and XY coordinates of the shoulder and rump for each pig. Weighted SNA was performed, based on the proximity of “standing” animals, for two 3-day period—the early (first month after mixing) and the later period (60 days post-mixing). Results: Group-level degree, betweenness, and closeness centralization showed a significant increase from the early-growing period to the later one (p < 0.02), highlighting the pigs’ social dynamics over time. Individual SNA traits were stable over these periods, except for the closeness centrality and clustering coefficient, which significantly increased (p < 0.00001). Conclusions: This study demonstrates that combining AI-assisted monitoring technologies with SNA offers a novel approach that can help farmers and breeders in optimizing on-farm management, breeding and welfare practices.

1. Introduction

Livestock and aquaculture species are usually housed in groups on breeding and commercial farms. Within these groups, both positive and negative social interactions play a significant role in shaping animal behavior, welfare, productivity, and health. Specifically, in pigs, negative social interactions have been found to impact access to resources, feeding behavior, and overall growth [1,2]. Moreover, these interactions can negatively affect welfare and stress levels, particularly when harmful behaviors, such as aggression or tail biting, occur [3,4]. Furthermore, both socially positive and negative forms of interaction, which involve close proximity, usually increase the risk of disease transmission [4,5]. Therefore, quantifying the structure and dynamics of social interactions within groups could provide crucial information to improve animal productivity, health, and welfare [6,7].
In this context, social network analysis (SNA) has become an essential tool for investigating the complex social structures of animal groups [8]. It enables the quantification of group-level social measures, e.g., centralization, which provide insights into the social structure of animal groups [9,10]. This method also facilitates the identification of subgroups, e.g., communities and cliques (representing fully connected individuals) [11], that share specific attributes and behavior [12]. SNA also provides individual-level traits that quantify the role of each animal within its social network [13,14]. This establishes SNA as a comprehensive tool for understanding social structures and their dynamics within commercial animal populations [15].
In pigs, SNA applied to manually extracted data from video recordings of group-housed individuals has revealed both the direct and indirect roles of each animal in pen-level aggression and association with resulting skin lesions [16,17,18]. Furthermore, research has demonstrated that SNA traits, quantifying individual centrality in aggression networks, are heritable and have favorable correlations, both at the phenotypic and genetic level, with economically important traits [16,19]. These findings suggest that SNA could help in the development of advanced breeding strategies to simultaneously improve animal performance and welfare. In practice, however, manually decoding video images to study animal social interactions is time-consuming and labor-intensive, and is prone to observer bias [20]. Recently, automated monitoring systems integrated with advanced artificial intelligence technologies, such as deep learning (DL), have shown considerable promise in improving the efficiency of observation and detection of farm animals and their behavior [21]. The application of DL and machine vision approaches in pigs has been shown to have high accuracy under farm conditions in identifying postures such as standing, sitting, and lying, as well as daily activities, like eating and drinking [22]. Furthermore, tracking technologies have offered digital phenotypes, at low cost, that record the movement and coordinates of the animals in real time under commercial farm conditions [23,24]. Compared to traditional animal monitoring methods, DL methods do not need to manually extract features, but take advantage of convolutional neural networks (CNN) to replace the traditional image processing, and achieve a high accuracy in monitoring animals under different farm conditions [25]. Moreover, AI-assisted systems reduce observer bias and improve accuracy by providing consistent data, avoiding human error, leading to more reliable and precise behavioral assessments. From a welfare perspective, AI-assisted monitoring also surpasses traditional behavioral observation methods as it also minimizes animal stress resulting from human presence and handling, ensuring more natural behavior.
This proof-of-concept study addresses, for the first time, the hypothesis that applying SNA approaches to automated data could potentially facilitate the analysis of social structures of animal populations and offer insights into their social interactions. The objectives of this study were to (1) evaluate the feasibility of using data from an on-farm computer monitoring system in commercial pigs coupled with DL to construct social networks, (2) gain new insights into the social structure and its dynamic changes within pens, and (3) identify the role of each animal in the social interactions occurring in groups of growing pigs in commercial farms.

2. Materials and Methods

2.1. Automated Data

Data were derived from automated recording systems that provide 2D camera images (See Figure 1) and video recordings of pigs in six pens, each containing 16–19 purebred animals, at a nucleus farm of the PIC breeding company (Hendersonville, TN, USA). The automated system provides real-time data derived from reading the ear tag, the number of seconds that has elapsed since the start of video recording, as well as the position and posture, e.g., standing, lying and sitting, for each animal. Video footage was processed using a multi-object tracking algorithm to extract individualized position and activity data [24]. Initially, a customized version of the DeepCut pose estimation algorithm detected key points on the pigs, such as midpoints, snouts, and right ear tag locations, and linked them to individual animals [26]. A CNN then identified each pig’s posture and activities (e.g., eating or drinking). Each pig was tracked frame-by-frame using the Hungarian algorithm [27], with any undetected pigs assumed to remain stationary. Reliable tracking was further supported by a custom ear-tag reading method developed by PIC [28,29]. The automated system also utilized DL algorithms to generate 2D XY coordinates for the front (shoulder) and rear (rump) positions of each pig, with measurements normalized to meters from the top-left corner of each pen (Figure 1). To ensure accurate data collection, a nine-month “learning period” was established for equipment fine-tuning and procedure optimization. Data from this period were excluded from analysis to prevent bias and ensure recording consistency (See details in [24]). Details on the system’s validation for accurately identifying individual animals’ postures (lying, sitting, standing), activities (eating, drinking), and positions (XY coordinates of the shoulder and rump) are provided in the Supplementary Material.

2.2. SNA

Social networks were constructed based on the automated tracking data to describe the contact structure of each of the six pens. To construct these networks and for subsequent SNA, a computational pipeline was developed using various R packages, i.e., spatsoc, version 0.2.2 [30], asnipe version 1.1.17 [31], sna version 2.28 [32], vegan version 2.6-10 [33], and igraph version 2.1.4 [34]. In this study, only “standing” animals were included in the social network construction. This approach enabled the investigation of social interactions only during active behavior, when proximity reflects decisions made by both animals in a dyad, providing insights into the social dynamics within a pen. For each pen, a total of 12 h per day of continuous interaction time between individuals was included in the SNA, spanning from 06:00 to 18:00, over three consecutive days. Furthermore, SNA was conducted for two separate 3-day periods: the early growing period (the first month after mixing) and a later growing period (60 days after mixing), to allow for the examination of the temporal changes in the social structure within the growing period. The average “standing” time/day for the pigs was 170.28 min (SD = 52.21 min) [24]. The XY coordinates of the pigs’ shoulders, along with timestamps provided by the automated system, were used to define the interactions of pigs within contemporary groups spanning the time period of 12 h per day for social network construction. Subsequently, a spatial analysis was performed to identify animals that interacted based on their proximity within this contemporary group. Here, proximity between animals within the same contemporary group was defined by a threshold of 0.5 m Euclidean distance between the shoulders, sustained for a duration longer than the average interaction time between individuals within each pen each day (Table S2). The chosen threshold of 0.5 m accommodates for potential measurement errors in the XY coordinates (see validation), and is within the range of previously identified proximity distances between 0.3 to 1 m defining interactions [35]. Based on the proximity of dyadic interactions, an undirected social network was constructed for each day (i.e., three consecutive days for both the early and late growing period for each pen). These networks were weighted based on the durations of proximity interactions between each dyad. Group-level SNA traits, e.g., group–degree centralization, group–closeness centralization, group–eigenvector centralization, group–betweenness centralization, density and modularity, were then computed, and combined over the three days from the social networks to quantify the social structure of each pen for each of the two growing periods. Temporal differences in these group-level SNA traits were then assessed using linear mixed models, with pen and day of measurement as random effects, growing period (early/late) as a fixed effect and pen size as a covariate. To further investigate the social dynamics and gain detailed insights into the social structure of the pen, community detection and clique analyses were performed for the social networks. For community detection, one of the most common methods used in animal populations was applied, i.e., the modularity-based methods implementing the Louvain algorithm [36]. For the clique analysis, the number of maximal cliques and the size of the largest clique were computed. Then, the temporal differences in the number of communities, the number of maximal cliques and the size of the largest clique were assessed using the same linear mixed models as described above. Due to the importance of cliques in the social structure, further analysis of the maximal cliques was also performed by identifying the co-membership matrix of these cliques [37]. The Mantel test was then performed to compare the clique co-membership matrices between days, and between the early and later growing periods, to provide insight into the development of cliques among pigs over the growth stages [33]. Finally, individual SNA traits were computed for each individual per day for the different growing periods. The definitions of the terminology and diverse SNA traits used in this study are shown in Table 1.

3. Results

The above-described SNA pipeline applied to the automated data produced weighted networks based on the proximity between animals in each pen within the two growth periods. Figure 2 shows SNA graphs for one of six pens, illustrating the connections reflecting pairwise interactions weighted by duration, the communities identified by the modularity-based method, members of the largest clique, and co-membership density for the maximal cliques.

3.1. Group-Level SNA Traits

The group-level SNA traits for the early and later growing periods of the studied pens are shown in Table 2. The least square means showed a significant difference in these group-level SNA traits between the two growing periods (Figure 3). For instance, group-level degree, betweenness, and closeness centralization showed a significant increase from the early growing period to the later growing period (p < 0.02). This would indicate that in the later growing period, a few individuals had very high centrality measures, while the majority had much lower values. In contrast, a non-significant increase was found for eigenvector centralization (p = 0.12). Also, the density of the network remained stable across both periods (p = 0.79), suggesting no significant change in the overall frequency and duration of social interactions between the pigs in different growing periods

3.2. Communities and Cliques

The descriptive statistics of the number of communities, number of maximal cliques, and largest clique size are shown in Table 3. No significant difference was observed for the mean number of communities between the early and late growing periods (p = 0.14) (Figure 3). Similarly, there was no change in the largest clique size from the early to the late growing period (p = 0.28). However, there was a significant decrease in the number of maximal cliques between the early and late growing periods (p = 0.007).
An inspection of the co-membership matrix of the maximal cliques provides some insights into groupings of high and low density within the pens (Figure 2d). High-density grouping in the co-membership matrix indicates that pairs or groups of animals spent significant amounts of time together in close proximity within a clique, reflecting strong social co-interactions between those animals. The results of the Mantel test, used to compare clique co-membership matrices within the pen, between the early and later growing periods reveal distinct patterns between pens in both the early and late growing periods (Figure 4). Overall, the correlations in clique co-membership across the 3 days of the early growing period, in the figure, are relatively low, indicating a weak co-membership in clique structures. These results suggest that during the early phase, individual proximity patterns are dynamic, with no consistent grouping trends emerging across days. In contrast, correlations across the 3 days in the later growing period were generally stronger and positive. Furthermore, the correlations between matrices of the early and late growing periods were relatively low, ranging between 0.20 to 0.44 in all pens (except for pen 6, where lower than 0.20 correlation estimates were observed), indicating that cliques were formed of different animals in the early compared to late growing period.

3.3. Individual SNA Traits

Table 4 presents the descriptive statistics of the individual SNA traits across the two growing periods. Overall, the individual SNA traits were stable over the two growing periods, except for closeness centrality and clustering coefficient (Figure 5). Specifically, the mean degree centrality for individuals remained stable across both periods, suggesting that the overall connectivity of individuals did not change over time. Similarly, no significant difference was observed in betweenness centrality between periods. Although eigenvector centrality showed a slight decrease from the early to the late growing period, this was not statistically significant. On the other hand, closeness centrality significantly increased from the early to the later growing period (p < 0.00001), although closeness was very low at both timepoints. The observed change indicates a notable shift in the proximity network structure across the growing periods, where the direct interactions of the central individuals with other members of the network increased. This shift could be due to the more limited space available in the pen as the pigs matured. Also, the clustering coefficient increased significantly from the early to the late growing period (p = 0.00006), indicating that individuals in the network tended to form more cohesive groups as time progressed.

4. Discussion

SNA is widely recognized as a valuable tool for investigating the social structures of animals, including livestock and aquaculture species [43]. Despite its potential, practical applications have often been hampered by insufficient data, as manual data collection is time-consuming and prone to observer bias [8]. However, recent advances in automated monitoring systems have significantly enhanced the ability to capture the positions and activities of animals, offering a high degree of reliability and accuracy, even in complex farm environments with factors such as motion blur and varying lighting conditions [22].
The automated system, which provided the data for the current study, employed a CNN that identifies each pig’s posture and activities (e.g., eating or drinking). Each pig was tracked frame-by-frame using the Hungarian algorithm [27], with any undetected pigs assumed to remain stationary. Reliable tracking was further supported by a custom ear-tag reading method developed by PIC. This ear tag identification system is capable of identifying all the studied pigs within the pen. Furthermore, the ear tags and the corresponding multi-object tracking algorithm enable the identification of animals even under challenging conditions such as varying orientations, mud, shadows, and motion blur [28,29]. The automated system and the AI routines were previously subjected to extensive quality control to confirm their reliability in recording and tracking pig position, posture and activities [24,28,29]. However, further validation analyses were also carried out in this study to ensure the reliability of these data (see validation, in the Supplementary Materials). The results of this validation show that the automated data, derived from DL algorithms, demonstrated a matching accuracy for the posture and activity of over 97% with a human observer, with the majority, i.e., 99%, of the errors observed in sitting/lying postures. Similar accuracies, ranging between 95 and 98%, were also reported in previous studies of an automated monitoring system used to classify pig posture and activities [22]. Furthermore, to validate the XY coordinates of these data, the size of the animals was simply calculated as the Euclidean distance between the shoulder and rump XY coordinates (Figure S1a). The repeatability estimates for the animal size, calculated as the within-individual repeatability coefficient of variation, ranged from 0.10 to 0.18 across pens (Table S1). This variability could be due to the change in animal positioning and posture, or measurement errors in the DL system [44,45]. These repeatability estimates suggest that the XY position data are sufficiently accurate for the construction of reliable contact networks based on proximity estimates derived from these position data, with corresponding error margins. Furthermore, the size of the same animal was then compared in different pen locations to evaluate the effect of potential distortion in video camera images on the derived XY coordinates (Figure S1b). The least square means show that the difference between the estimates for the inner and outer area of the pen never exceeded 0.15 m Euclidean distance across all the studied pens (Figure S2). Based on these observed small variabilities during the validations of XY coordinates, proximity was defined in this study as a Euclidean distance of less or equal to 0.5 m between the shoulders of “standing” pigs, sustained for a duration exceeding the average interaction time between each pair of individuals within each pen each day (Table 1). This definition accounted for measurement variations in the XY coordinates and aligned with previously reported proximity distances (0.3–1 m) used to define interactions of pigs [35,46]. Furthermore, proximity durations exceeding the daily average pen proximity were considered to further address these variations, ensuring that only sustained interactions were included in the construction of the network, while filtering out incidental or brief social proximity.
The aim of this study was to demonstrate the feasibility of constructing informative social contact networks from proximity measures derived from the automated position data. To this end, a computational pipeline was developed to show that SNA applied to automated real-time position data facilitates the detailed observation and characterization of social interactions between pigs within a pen by converting automated data into visual graphs and quantitative network measures. In particular, the study demonstrates the ability of SNA to reveal the strength and stability of interactions, community divisions, and subgroup cohesion within a pen’s social structure (Figure 2).

4.1. Group-Level SNA

SNA offers the potential of quantifying the social structure of groups, using the social interaction data, providing informative group-level SNA traits [13]. Here, group-level SNA showed a notable change in social network dynamics over the two growing periods, emphasizing the evolution of social interactions among individuals over time (Figure 3). Group-degree centralization, closeness centralization and betweenness centralization increased significantly between the early and later growing periods. The increase in group-level centralization suggests that, over time, fewer animals occupied a highly central position with respect to proximity, whilst more animals adopted a peripheral network position and showed proximity with a restricted number of group members. This may reflect the growing familiarity between animals and the establishment of a clearer social hierarchy within the pen. These results are in accordance with previous studies, which have shown that pigs adapt to stable group settings by forming stronger and more consistent social bonds [47]. This adaptation suggests that pigs’ social structures evolve as they become more accustomed to their environment, which could have a direct effect on the expression of harmful behavior, e.g., aggressive interactions.
In contrast, eigenvector centralization and modularity showed no significant change from the early to the later growing period (p = 0.12), and the network density also remained stable across both periods (p = 0.79). This stability suggests that, despite individual changes in social roles, the core structure of proximity behaviors remained consistent throughout the growing periods. This could be attributed to the controlled environment in which the studied pigs were raised, which may have minimized disruptions to their social dynamics. Similar findings have been reported in previous studies, where the lack of significant environmental stressors may have allowed the pigs to maintain their established social patterns over time [1,2]. However, it would be interesting to assess the consequences for the group-level centralization under changing environments, such as dietary or health challenges, or the re-mixing of pigs and in particular the removal of high-centrality individuals from the pen, in future investigations.

4.2. Communities and Cliques

The number of communities remained relatively stable across the early and late growing periods (p = 0.14) (Figure 2b and Figure 3), as did the size of the largest clique. Maintaining similar community structures over time may indicate a relatively stable social structure within a pen, where pigs continue interacting with the same number of individuals across both periods. On the other hand, the significant reduction in the number of maximal cliques from the early to the late period highlights a marked shift in the network’s subgroup structure. Maximal cliques represent fully connected individuals, and the decrease in their number during the late growing period suggests that the social network became less concentrated within certain cliques of individuals [11].
Forming cliques has been found to be beneficial for the stability of a group. For instance, Foister et al. [17] observed that pens with cliques, during the 24 h period post-mixing, had lower rates of aggression-related injuries three weeks later. However, the same authors also reported that the members of such cliques would suffer higher rates of injuries compared to the non-clique-members in the first 24 h. Similarly, at the genetic level, Agha et al. [19] reported that there is a high positive genetic correlation between clique membership in aggression networks and anterior skin lesions 24 h post-mixing, but a strong negative genetic correlation with anterior skin lesions after three weeks post-mixing. This highlights the importance of identifying the key animals that frequently participate in such cliques, to increase social stability within a pen. Given this importance, a comprehensive co-membership analysis was conducted for the maximal cliques in the current study. This analysis, along with the visualization of cliques, provided a more detailed insight into the patterns of intense social interactions within the network (Figure 2d). Specifically, the Mantel test results, comparing clique co-membership matrices between the early and late growing periods, provide a deeper insight into the development of social cliques among pigs through different growth stages. In the early growing period, there was a relatively low correlation between days across all pens, suggesting that pigs exhibit less defined social relationships, especially when forming cliques. The dynamic nature of these early relationships likely reflects the exploratory behavior of pigs during the initial stages of group formation when dominance hierarchies and stable social groups have yet to be fully established [1,48]. Higher correlations during the later growth stages and the low correlations observed in clique co-membership matrices between the two growth periods imply that pigs tend to maintain more stable proximity patterns over time (Figure 4). This trend toward stability in social grouping aligns with research showing that pigs form more cohesive social groups over time, as they establish a relatively stable dominance hierarchy and potentially preferential affiliative relationships become more established [49]. The increasing stability in clique structures could reduce social tension and aggression, which is advantageous for welfare and productivity as pigs approach market weight [50]. Understanding these patterns is important for improving group housing systems in commercial pig production.
It is also noteworthy that the co-membership analyses revealed differences in social patterns across groups. In this study, pen 6 was an exception to the above, where the Mantel correlations remained lower compared to other pens, suggesting that the pigs in this pen may have experienced different social dynamics. These variations could be attributed to factors such as changes in environmental or physical conditions (e.g., disease), or to the mix of individual personalities and attributes such as cognitive ability [51]. Further investigation into the specific conditions could help explain these discrepancies.
Finally, it should be noted that proximity when active could indicate engagement in positive (affiliative) or negative social interactions (such as aggression). Under commercial farming conditions, the formation of communities and cliques in the pen could be partly influenced by the distribution of feeding and water resources, group size and pen type. Although this was not explicitly considered in the current study, this hypothesis could be further investigated by constructing social networks for the area around these resources and performing community detection and clique analyses. By identifying the high- and low-density areas associated with resource locations, adjustments to the placement of resources could be made in order to reduce competition and harmful behaviors among pigs. Furthermore, it is worth noting that this study analyzed two separate 3-day periods, e.g., the early and later growing periods. Including additional days would offer deeper insights into the social structures of pigs; however, this is beyond the scope of the current proof-of-concept study.

4.3. Individual SNA Traits

SNA also offers informative individual measures that quantify the roles of individuals in social interactions [10]. The population-level stability of key individual SNA traits such as degree centrality and betweenness centrality was assessed over the two growing periods. Stability in degree centrality implies that socially influential individuals maintain their status over time, which can be leveraged for management and breeding purposes. Likewise, the consistency in betweenness centrality indicates that key pigs consistently bridge different parts of the social network over the growing period. This stability could be useful for group management when identifying pigs that play critical roles in the social structure, ensuring that these animals are strategically managed to maintain network cohesion. This stability also implies that disease transmission within a pen may persistently operate through the same key individuals [52].
On the other hand, the significant increase in individuals’ closeness centrality and clustering coefficients observed from the early to late growing periods suggests that as pigs mature, their social dynamics evolve. This change may be linked to the pigs’ adaptation to their environment and the establishment of more defined social relationships as they grow. Closeness centrality measures how close an individual is to all other members in the network, reflecting the direct connections between a focal animal and other animals in the network (Table 1). As pigs grow, an increase in closeness centrality could result from the establishment of stronger social bonds, spatial constraints, and the development of social hierarchies. During the early growing period, pigs have more space to move and interact, leading to lower centrality scores as interactions may be more dispersed. As pigs mature and the space becomes more limited, their interactions become more frequent, leading to a more saturated social network. Additionally, as pigs establish a social hierarchy within the pen, certain individuals may occupy more central positions, interacting more with others and thus increasing their closeness centrality score. Similarly, the increase in clustering coefficient reflects the formation of more cohesive subgroups over time, likely as pigs become more familiar with their pen mates and develop stronger social bonds. The significant changes in these traits indicate that proximity behaviors shift as pigs adapt and mature. Similar results were also observed in primates [53] and wild animals [54].

4.4. Implications for Management and Breeding

This proof-of-concept study has demonstrated that integrating AI assisted automated monitoring technologies with SNA provides an efficient, real-time method for analyzing animal social interactions, advancing beyond traditional manual observation techniques. While this study focused on pigs, utilizing our data and experience with this species, the methods developed can be broadly applicable to other livestock and aquaculture species. The decreasing cost of monitoring technologies and the growing adoption of automated systems in these industries yield valuable data that require innovative analytical approaches for deriving quantitative measures that can be effectively used to improve the management and/or breeding of farm animals [9,10]. This information could potentially be used for optimizing group compositions to reduce competition or increase positive interactions between animals in the pen. Furthermore, since individual SNA traits are heritable and favorably correlated with key economic traits, incorporating them into breeding programs could potentially improve the accuracy of predicting social compatibility in animals in commercial farms [16,19].
In the welfare context, combining the application of SNA and automated monitoring extends beyond productivity to potentially significantly enhance animal well-being in commercial farms [15]. Understanding the social dynamics within a pen allows for the early identification of harmful social behavior, e.g., aggression or tail biting [55]. Also, the community detection and identification of clique members can be used at the farm level to create more homogeneous groups, minimize stress and promote positive interaction between animals. Improved welfare not only addresses ethical responsibilities, but also has a direct impact on the long-term productivity of farm animals [6].
In health and disease management, automated monitoring and sensor technologies have emerged as a promising tool for tracking and managing disease incidences in farm animals [56]. Integrating SNA with automated data thus offers a powerful tool for understanding disease transmission and managing it in farm animals [52]. For instance, identifying key individuals, e.g., those with high degree and betweenness centrality, could help map transmission pathways. These traits also enable early and targeted interventions, such as detecting animals exhibiting abnormal interactions or withdrawing from social contact, which might indicate sickness, and adjusting group compositions to limit disease spread [57]. This proactive approach to health management not only reduces disease transmission, but would also help in reducing the excessive use of antibiotics and vaccines, contributing to more sustainable farming practices. Scientifically, SNA could be used to parameterize epidemiological models of infection spread, allowing for more accurate model predictions [52].
However, it is important to note that this study focused on non-directional weighted networks based on the duration of proximity between pigs in a standing position. While such proximity data can be significant for disease transmission studies [58], they may not fully capture the complexity of social interactions related to productivity and welfare issues. Therefore, to gain a more comprehensive understanding, directed network such as those reflecting routes of disease transmission or feeding interactions, or distinguishing between positive and negative behaviors (e.g., play-fighting versus harmful aggression), should be investigated in future studies, as they may provide more insights into social dynamics [15]. Additionally, future studies should also consider potential environmental factors (e.g., spatial constraints and group composition) that may influence the reliability and interpretation of network data. By breeding pigs for desirable social traits, producers can enhance group cohesion and overall health, leading to more efficient production systems and improved animal welfare.

5. Conclusions

This proof-of-concept study demonstrates the feasibility and potential of integrating SNA with automated monitoring data and AI tools to construct informative social contact networks. By evaluating group-level SNA traits, identifying community structures, analyzing clique co-membership, and assessing individual SNA traits, we gained novel insights into the social interactions of group-housed pigs under commercial farm conditions, and how these change over time. These novel insights highlight the promise that SNA offers for optimizing management practices and improving animal performance, health, and welfare of farm animals. These findings could help farmers and breeders to better monitor social interactions and understand social structures, identify key individuals within the group, and tailor management and breeding practices to reduce stress, and improve welfare and productivity.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/ani15070996/s1, Figure S1: (a) The calculation of the animal size based on the Euclidean distance calculated from the XY coordinates of the shoulder and rump, (b) validation for potential distortion in video camera images by dividing the pen into two distinct areas based on XY coordinates. The inner area of the pen is defined by X-coordinates ranging from 1.5 m to 4.5 m and Y-coordinates ranging from 1 m to 2 m, measured from the top-left corner of the pen. Figure S2: Least square means from the mixed model analysis of size estimates corresponding to the inner (in blue) and outer areas (in red) of the pen for (a) the early and (b) late growing periods. Table S1: Descriptive statistics for the size of the animals calculated based on the Euclidean distance between shoulder and rump XY coordinates for each pen per growing period. Table S2: Descriptive statistics of the proximity time between each pair of animals in each day in the two growing periods (early = 1 and late = 2).

Author Contributions

S.A. (conceptualization, data curation, formal analysis, funding acquisition, investigation, methodology, resources, software, validation, visualization, writing—original draft); E.P. (data curation, formal analysis, methodology, software, writing—review and editing); S.P.T. (conceptualization, funding acquisition, methodology, investigation, writing—review and editing); C.R.G.L. (conceptualization, funding acquisition, investigation, writing—review and editing); J.P.S. (funding acquisition, investigation, writing—review and editing); A.D.-W. (conceptualization, formal analysis, funding acquisition, investigation, methodology, project administration, supervision, resources, validation, visualization, writing—review and editing). All authors have read and agreed to the published version of the manuscript.

Funding

The research was funded by the BBSRC through the Impact Acceleration Accounts (IAAs) (BBSRC IAA PIII108), and Partner with international researchers on AI for Bioscience fund (BB/Y513891/1), and by the Animal Welfare Foundation (grant AWF_2022_04_AD). Contributions from Andrea Doeschl-Wilson were also funded by the Roslin Institute Strategic Programme Grant awarded by BBSRC (BB/X010945/1 and BB/X010937/1). SRUC receives support from the Scottish Government Strategic Research Programme.

Institutional Review Board Statement

All procedures conducted in this study complied with relevant national and institutional guidelines for the care and use of animals and were approved by the appropriate institutional ethics committee(s). The research adhered to established ethical standards to ensure the welfare of the animals involved.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author.

Conflicts of Interest

Author Eric Psota was employed by the company PIC North America. The remaining authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

References

  1. Boumans, I.J.M.M.; de Boer, I.J.M.; Hofstede, G.J.; Bokkers, E.A.M. How social factors and behavioural strategies affect feeding and social interaction patterns in pigs. Physiol. Behav. 2018, 194, 23–40. [Google Scholar] [CrossRef]
  2. Maselyne, J.; Saeys, W.; Van Nuffel, A. Review: Quantifying animal feeding behaviour with a focus on pigs. Physiol. Behav. 2015, 138, 37–51. [Google Scholar] [CrossRef]
  3. Wellock, I.J.; Emmans, G.C.; Kyriazakis, I. Predicting the consequences of social stressors on pig food intake and performance. J. Anim. Sci. 2003, 81, 2995–3007. [Google Scholar] [CrossRef] [PubMed]
  4. Baekbo, P.; Kristensen, C.S.; Larsen, L.E. Porcine circovirus diseases: A review of PMWS. Transbound. Emerg. Dis. 2012, 59 (Suppl. S1), 60–67. [Google Scholar] [CrossRef] [PubMed]
  5. Chase-Topping, M.; Xie, J.; Pooley, C.; Trus, I.; Bonckaert, C.; Rediger, K.; Bailey, R.I.; Brown, H.; Bitsouni, V.; Barrio, M.B.; et al. New insights about vaccine effectiveness: Impact of attenuated PRRS-strain vaccination on heterologous strain transmission. Vaccine 2020, 38, 3050–3061. [Google Scholar] [CrossRef] [PubMed]
  6. Brakes, P. Sociality and wild animal welfare: Future directions. Front. Vet. Sci. 2019, 6, 1–7. [Google Scholar] [CrossRef]
  7. Turner, S.P. Breeding against harmful social behaviours in pigs and chickens: State of the art and the way forward. Appl. Anim. Behav. Sci. 2011, 134, 1–9. [Google Scholar] [CrossRef]
  8. Wey, T.; Blumstein, D.T.; Shen, W.; Jordán, F. Social network analysis of animal behaviour: A promising tool for the study of sociality. Anim. Behav. 2008, 75, 333–344. [Google Scholar] [CrossRef]
  9. Croft, D.P.; Madden, J.R.; Franks, D.W.; James, R. Hypothesis testing in animal social networks. Trends Ecol. Evol. 2011, 26, 502–507. [Google Scholar] [CrossRef]
  10. Farine, D.R.; Whitehead, H. Constructing, conducting and interpreting animal social network analysis. J. Anim. Ecol. 2015, 84, 1144–1163. [Google Scholar] [CrossRef]
  11. Akkoyunlu, E.A. The Enumeration of Maximal Cliques of Large Graphs. SIAM J. Comput. 2006, 2, 1–6. [Google Scholar] [CrossRef]
  12. Croft, D.P.; James, R.; Thomas, P.O.R.; Hathaway, C.; Mawdsley, D.; Laland, K.N.; Krause, J. Social structure and co-operative interactions in a wild population of guppies (Poecilia reticulata). Behav. Ecol. Sociobiol. 2006, 59, 644–650. [Google Scholar] [CrossRef]
  13. Farine, D.R. Measuring phenotypic assortment in animal social networks: Weighted associations are more robust than binary edges. Anim. Behav. 2014, 89, 141–153. [Google Scholar] [CrossRef]
  14. Agha, S.; Fàbrega, E.; Quintanilla, R.; Sánchez, J.P. Social Network Analysis of Agonistic Behaviour and Its Association with Economically Important Traits in Pigs. Animals 2020, 10, 2123. [Google Scholar] [CrossRef]
  15. Koene, P.; Ipema, B. Social networks and welfare in future animal management. Animals 2013, 4, 93–118. [Google Scholar] [CrossRef]
  16. Agha, S.; Foister, S.; Roehe, R.; Turner, S.P.; Doeschl-Wilson, A. Genetic Analysis of Novel Behaviour Traits in Pigs Derived from Social Network Analysis. Genes 2022, 13, 561. [Google Scholar] [CrossRef]
  17. Foister, S.; Doeschl-Wilson, A.; Roehe, R.; Arnott, G.; Boyle, L.; Turner, S. Social network properties predict chronic aggression in commercial pig systems. PLoS ONE 2018, 13, e0205122. [Google Scholar] [CrossRef]
  18. Büttner, K.; Czycholl, I.; Mees, K.; Krieter, J. Agonistic Interactions in Pigs–Comparison of Dominance Indices with Parameters Derived from Social Network Analysis in Three Age Groups. Animals 2019, 9, 929. [Google Scholar] [CrossRef] [PubMed]
  19. Agha, S.; Turner, S.P.; Lewis, C.R.G.; Desire, S.; Roehe, R.; Doeschl-Wilson, A. Genetic Associations of Novel Behaviour Traits Derived from Social Network Analysis with Growth, Feed Efficiency, and Carcass Characteristics in Pigs. Genes 2022, 13, 1616. [Google Scholar] [CrossRef]
  20. Frost, A.R.; Schofield, C.P.; Beaulah, S.A.; Mottram, T.T.; Lines, J.A.; Wathes, C.M. A review of livestock monitoring and the need for integrated systems. Comput. Electron. Agric. 1997, 17, 139–159. [Google Scholar] [CrossRef]
  21. Riekert, M.; Klein, A.; Adrion, F.; Hoffmann, C.; Gallmann, E. Automatically detecting pig position and posture by 2D camera imaging and deep learning. Comput. Electron. Agric. 2020, 174, 105391. [Google Scholar] [CrossRef]
  22. Ocepek, M.; Žnidar, A.; Lavrič, M.; Škorjanc, D.; Andersen, I.L. DigiPig: First Developments of an Automated Monitoring System for Body, Head and Tail Detection in Intensive Pig Farming. Agriculture 2021, 12, 2. [Google Scholar] [CrossRef]
  23. Zhang, Z.; Zhang, H.; He, Y.; Liu, T. A Review in the Automatic Detection of Pigs Behavior with Sensors. J. Sens. 2022, 2022, 4519539. [Google Scholar] [CrossRef]
  24. Hollifield, M.K.; Chen, C.Y.; Psota, E.; Holl, J.; Lourenco, D.; Misztal, I. Estimating genetic parameters of digital behavior traits and their relationship with production traits in purebred pigs. Genet. Sel. Evol. 2024, 56, 29. [Google Scholar] [CrossRef]
  25. Yang, Q.; Xiao, D. A review of video-based pig behavior recognition. Appl. Anim. Behav. Sci. 2020, 233, 105146. [Google Scholar] [CrossRef]
  26. Pishchulin, L.; Insafutdinov, E.; Tang, S.; Andres, B.; Andriluka, M.; Gehler, P.; Schiele, B. DeepCut: Joint subset partition and labeling for multi person pose estimation. In Proceedings of the IEEE Computer Society Conference on Computer Vision and Pattern Recognition 2016, Las Vegas, NV, USA, 27–30 June 2016; pp. 4929–4937. [Google Scholar] [CrossRef]
  27. Kuhn, H.W. The Hungarian method for the assignment problem. Nav. Res. Logist. Q. 1955, 2, 83–97. [Google Scholar] [CrossRef]
  28. Peace, J.B.; Psota, E.; Liu, Y.; Pérez, L.C. E2ETag: An End-to-End Trainable Method for Generating and Detecting Fiducial Markers. In Proceedings of the British Machine Vision Conference (BMVC), Manchester, UK, 7–10 September 2020. [Google Scholar]
  29. Psota, E.; Fitzgerald, R.; Herring, W. Random 4-Characters Animal ID using Human-Readable Fiducials and Simulation-Based Training. In Proceedings of the CV4 Animals Workshop in Conjunction with the IEEE Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 28–24 June 2022. [Google Scholar]
  30. Robitaille, A.L.; Webber, Q.M.R.; Vander Wal, E. Conducting social network analysis with animal telemetry data: Applications and methods using spatsoc. Methods Ecol. Evol. 2019, 10, 1203–1211. [Google Scholar] [CrossRef]
  31. Farine, D.R. Animal social network inference and permutations for ecologists in R using asnipe. Methods Ecol. Evol. 2013, 4, 1187–1194. [Google Scholar] [CrossRef]
  32. Butts, T. “Sna” Package in R Software. 2019. Available online: https://cran.r-project.org/web/packages/sna/index.html (accessed on 1 October 2023).
  33. Oksanen, J.; Simpson, G.; Blanchet, F.; Kindt, R.; Legendre, P.; Minchin, P.; O’Hara, R.; Solymos, P.; Stevens, M.; Szoecs, E.; et al. vegan: Community Ecology Package. R package version 2.7-0. 2025. Available online: https://github.com/vegandevs/vegan (accessed on 1 October 2023).
  34. Csardi, G.; Nepusz, T.; Traag, V.; Horvát, S.; Zanini, F.; Noom, D.; Müller, K.; igraph: Network Analysis and Visualization in R. R package version 2.1.4. 2025. Available online: https://CRAN.R-project.org/package=igraph (accessed on 1 October 2023).
  35. Camerlink, I.; Scheck, K.; Cadman, T.; Rault, J.L. Lying in spatial proximity and active social behaviours capture different information when analysed at group level in indoor-housed pigs. Appl. Anim. Behav. Sci. 2022, 246, 105540. [Google Scholar] [CrossRef]
  36. Blondel, V.D.; Guillaume, J.L.; Lambiotte, R.; Lefebvre, E. Fast unfolding of communities in large networks. J. Stat. Mech. Theory Exp. 2008, 2008, P10008. [Google Scholar] [CrossRef]
  37. Wasserman, S.; Faust, K. Social Network Analysis; Cambridge University Press: Cambridge, UK, 1994. [Google Scholar] [CrossRef]
  38. Newman, M.E. Finding Community Structure in Networks Using the Eigenvectors of Matrices. Phys. Rev. E 2006, 74, 036104. [Google Scholar] [CrossRef]
  39. Freeman, L.C. Centrality in social networks conceptual clarification. Soc. Netw. 1978, 1, 215–239. [Google Scholar] [CrossRef]
  40. Newman, M.E.J. Modularity and community structure in networks. Proc. Natl. Acad. Sci. USA 2006, 103, 8577–8582. [Google Scholar] [CrossRef] [PubMed]
  41. Seifikar, M.; Farzi, S.; Barati, M. C-Blondel: An Efficient Louvain-Based Dynamic Community Detection Algorithm. IEEE Trans. Comput. Soc. Syst. 2020, 7, 308–318. [Google Scholar] [CrossRef]
  42. Makino, K.; Uno, T. New Algorithms for Enumerating All Maximal Cliques. Lect. Notes Comput. Sci. 2004, 3111, 260–272. [Google Scholar] [CrossRef]
  43. Croft, D.P.; Darden, S.K.; Wey, T.W. Current directions in animal social networks. Curr. Opin. Behav. Sci. 2016, 12, 52–58. [Google Scholar] [CrossRef]
  44. Alameer, A.; Buijs, S.; O’Connell, N.; Dalton, L.; Larsen, M.; Pedersen, L.; Kyriazakis, I. Automated detection and quantification of contact behaviour in pigs using deep learning. Biosyst. Eng. 2022, 224, 118–130. [Google Scholar] [CrossRef]
  45. Matthews, S.G.; Miller, A.L.; Plötz, T.; Kyriazakis, I. Automated tracking to measure behavioural changes in pigs for health and welfare monitoring. Sci. Rep. 2017, 7, 17582. [Google Scholar] [CrossRef]
  46. Goumon, S.; Illmann, G.; Leszkowová, I.; Dostalová, A.; Cantor, M. Dyadic affiliative preferences in a stable group of domestic pigs. Appl. Anim. Behav. Sci. 2020, 230, 105045. [Google Scholar] [CrossRef]
  47. Coutellier, L.; Arnould, C.; Boissy, A.; Orgeur, P.; Prunier, A.; Veissier, I.; Meunier-Salaün, M.C. Pig’s responses to repeated social regrouping and relocation during the growing-finishing period. Appl. Anim. Behav. Sci. 2007, 105, 102–114. [Google Scholar] [CrossRef]
  48. Oldham, L.; Camerlink, I.; Arnott, G.; Doeschl-Wilson, A.; Farish, M.; Turner, S.P. Winner–loser effects overrule aggressiveness during the early stages of contests between pigs. Sci. Rep. 2020, 10, 13338. [Google Scholar] [CrossRef] [PubMed]
  49. Weller, J.E.; Camerlink, I.; Turner, S.P.; Farish, M.; Arnott, G. Socialisation and its effect on play behaviour and aggression in the domestic pig (Sus scrofa). Sci. Rep. 2019, 9, 1–11. [Google Scholar] [CrossRef]
  50. Peden, R.S.E.; Turner, S.P.; Boyle, L.A.; Camerlink, I. The translation of animal welfare research into practice: The case of mixing aggression between pigs. Appl. Anim. Behav. Sci. 2018, 204, 1–9. [Google Scholar] [CrossRef]
  51. Peden, R.S.E.; Akaichi, F.; Camerlink, I.; Boyle, L.A.; Turner, S.P. Factors influencing farmer willingness to reduce aggression between pigs. Animals 2019, 9, 6. [Google Scholar] [CrossRef] [PubMed]
  52. Dubé, C.; Kelton, D.F.; Dubé, C.; Ribble, C.; Kelton, D.; Mcnab, B. Inroduction to network analysis and its implications for animal disease modelling Introduction to network analysis and its implications for animal disease modelling. Rev. Sci. Tech. 2011, 30, 425–436. [Google Scholar] [CrossRef]
  53. Pasquaretta, C.; Levé, M.; Claidiere, N.; Van De Waal, E.; Whiten, A.; MacIntosh, A.J.J.; Pelé, M.; Bergstrom, M.L.; Borgeaud, C.; Brosnan, S.F.; et al. Social networks in primates: Smart and tolerant species have more efficient networks. Sci. Rep. 2014, 4, 1–8. [Google Scholar] [CrossRef]
  54. Cheney, D.L.; Silk, J.B.; Seyfarth, R.M. Network connections, dyadic bonds and fitness in wild female baboons. R. Soc. Open Sci. 2016, 3, 160255. [Google Scholar] [CrossRef]
  55. Llonch, P.; Mainau, E.; Temple, D.; Manteca, X. Aggression in Pigs and Its Welfare Consequences. Fawec 2017, 19, 1–2. [Google Scholar]
  56. Alba-Casals, A.; Allue, E.; Tarancon, V.; Baliellas, J.; Novell, E.; Napp, S.; Fraile, L. Near Real-Time Monitoring of Clinical Events Detected in Swine Herds in Northeastern Spain. Front. Vet. Sci. 2020, 7, 68. [Google Scholar] [CrossRef]
  57. Lichoti, J.K.; Davies, J.; Kitala, P.M.; Githigia, S.M.; Okoth, E.; Maru, Y.; Bukachi, S.A.; Bishop, R.P. Social network analysis provides insights into African swine fever epidemiology. Prev. Vet. Med. 2016, 126, 1–10. [Google Scholar] [CrossRef]
  58. Chen, S.; White, B.J.; Sanderson, M.W.; Amrine, D.E.; Ilany, A.; Lanzas, C. Highly dynamic animal contact network and implications on disease transmission. Sci. Rep. 2014, 4, 4472. [Google Scholar] [CrossRef]
Figure 1. The 2D camera images provided by the automated recording systems, which show the ear tag, position and posture, e.g., standing (with red line) and sitting (blue line), for each pig within the pen (Animals’ ID have been anonymized for this illustration).
Figure 1. The 2D camera images provided by the automated recording systems, which show the ear tag, position and posture, e.g., standing (with red line) and sitting (blue line), for each pig within the pen (Animals’ ID have been anonymized for this illustration).
Animals 15 00996 g001
Figure 2. Social network graphs for one of the studied pens for one of the studied days, showing: (a) a network where connections (edges) represent proximity between nodes (animals), with the thickness of the edges indicating the duration of pairwise proximity; (b) the same network analyzed using a modularity-based method to identify distinct communities, represented by colored nodes, within the network; (c) the same network highlighting key animals, shown in black, that are members of the largest clique, and (d) the same network analyzed for co-membership in maximal cliques illustrating high-density areas, associated with thick edges, between individuals that frequently co-occurred in maximal cliques.
Figure 2. Social network graphs for one of the studied pens for one of the studied days, showing: (a) a network where connections (edges) represent proximity between nodes (animals), with the thickness of the edges indicating the duration of pairwise proximity; (b) the same network analyzed using a modularity-based method to identify distinct communities, represented by colored nodes, within the network; (c) the same network highlighting key animals, shown in black, that are members of the largest clique, and (d) the same network analyzed for co-membership in maximal cliques illustrating high-density areas, associated with thick edges, between individuals that frequently co-occurred in maximal cliques.
Animals 15 00996 g002
Figure 3. Least square means of group-level SNA traits, communities, and clique traits by growing period. Growing periods not connected by the same letter are significantly different at p < 0.05, where period 1 = early growing period and period 2 = late growing period.
Figure 3. Least square means of group-level SNA traits, communities, and clique traits by growing period. Growing periods not connected by the same letter are significantly different at p < 0.05, where period 1 = early growing period and period 2 = late growing period.
Animals 15 00996 g003aAnimals 15 00996 g003b
Figure 4. Mantel test for clique co-membership correlation between different days in the early growing period and late growing period for the six studied pens.
Figure 4. Mantel test for clique co-membership correlation between different days in the early growing period and late growing period for the six studied pens.
Animals 15 00996 g004
Figure 5. Least square means of the individual SNA traits in different growing periods. Periods not connected by the same letter are significantly different at (p < 0.05), where period 1 = early growing period and period 2 = late growing period.
Figure 5. Least square means of the individual SNA traits in different growing periods. Periods not connected by the same letter are significantly different at (p < 0.05), where period 1 = early growing period and period 2 = late growing period.
Animals 15 00996 g005
Table 1. Definition of the terminology and diverse SNA traits used in this study.
Table 1. Definition of the terminology and diverse SNA traits used in this study.
MeasureDefinition
ProximityProximity was defined by a threshold of 0.5 m Euclidean distance between the shoulders of the “standing” pigs, which was sustained for a duration longer than the average interaction time between each pair of individuals within each pen each day.
Weighted SNA graphA representation of a network where the edges (interactions) between nodes (animals) are assigned numerical values (weights) that reflect the duration of the interactions (proximity).
Individual degree centrality The number of edges (i.e., interactions) attached to a node (animal).
Individual betweenness centrality Betweenness centrality in a weighted network represents how often a node (or individual) acts as a bridge along the shortest paths between other nodes.
Individual closeness centralityThe sum of the direct connections between a focal node and other nodes in the network.
Individual eigenvector centralityThe connectivity of a node according to the all-degree centrality of the node and the all-degree centrality of the nodes that it connects with [16,38].
Individual clustering coefficientThe proportion of an individual node’s connections that are also connected with each other relative to the number of theoretically possible connections [10].
Centralization A graph-level centralization is computed from the individual centrality scores of the nodes using the formula
Centralization = i = 1 n C max C i maximum   possible   centralization where Cmax is the centrality of the most central node. Ci is the centrality of the node, and the centralization was normalized by dividing by the maximum theoretical score for a graph with the same number of nodes [39]. For degree, closeness and betweenness centralization, the most centralized structure is a network where a small number of nodes hold most of the connections. For eigenvector centralization, a high centralization graph indicates that a small number of nodes have a very high eigenvector centrality, while the majority have much lower values.
DensityThe ratio of the number of edges of the network relative to the total number of possible edges in a group of the same size.
Modularity The strength of the division of a network into communities. It evaluates how well the network is divided into subgroups, where nodes within the same subgroup (or community) are more densely connected to each other than to nodes in other groups [40].
Community detectionThe process of identifying subgroups or clusters of nodes within a network that are more densely connected internally compared to the connections in the network [40].
Modularity-based community detections methodThe modularity-based method, using the Louvain algorithm for community detections, aims to maximize the modularity score to identify densely connected subgroups within the network [41].
CliqueA subset of nodes where every node is directly connected to every other node in the subset.
Maximal clique A clique is maximal if there is no node in the graph that can be added to this clique to create a larger clique without violating the clique property [42].
Co-membershipThe relationship between nodes based on shared membership in specific cliques.
Largest clique sizeA clique with the maximum number of nodes among all cliques in that graph [42].
Table 2. Descriptive statistics of the group-level SNA traits over 3 days each for the early and later growing periods.
Table 2. Descriptive statistics of the group-level SNA traits over 3 days each for the early and later growing periods.
PenPeriodGroup DegreeGroup ClosenessGroup EigenvectorGroup BetweennessDensityModularity
Mean
(SD)
MaxMinMean
(SD)
MaxMinMean (SD)MaxMinMean
(SD)
MaxMinMean
(SD)
MaxMinMean
(SD)
MaxMin
110.36
(0.08)
0.440.280.30
(0.27)
0.500.000.48
(0.06)
0.530.410.12
(0.07)
0.180.040.40
(0.04)
0.440.360.15
(0.06)
0.220.10
120.37
(0.08)
0.470.320.42
(0.12)
0.560.350.45
(0.01)
0.450.450.18
(0.05)
0.240.140.40
(0.02)
0.420.390.12
(0.04)
0.150.08
210.25
(0.06)
0.320.200.29
(0.09)
0.390.230.37
(0.05)
0.420.330.09
(0.01)
0.100.080.44
(0.02)
0.460.420.19
(0.02)
0.200.17
220.3
(0.13)
0.450.220.35
(0.18)
0.550.230.42
(0.04)
0.460.390.14
(0.1)
0.250.080.42
(0.01)
0.430.410.14
(0.03)
0.170.11
310.31
(0.1)
0.410.220.34
(0.12)
0.480.240.40
(0.07)
0.470.330.12
(0.05)
0.180.080.42
(0.01)
0.420.420.15
(0.03)
0.180.12
320.26
(0.09)
0.360.200.32
(0.11)
0.450.240.43
(0.04)
0.460.390.11
(0.04)
0.150.080.41
(0.03)
0.440.380.18
(0.02)
0.190.16
410.31
(0.03)
0.340.280.13
(0.22)
0.380.000.41
(0.02)
0.430.400.10
(0.06)
0.160.040.44
(0.01)
0.440.430.13
(0.04)
0.170.10
420.37
(0.04)
0.400.330.45
(0.02)
0.460.430.45
(0.03)
0.470.410.16
(0.03)
0.180.120.44
(0.04)
0.480.410.14
(0.03)
0.170.12
510.27
(0.01)
0.280.260.30
(0.03)
0.320.270.42
(0.03)
0.460.400.09
(0.02)
0.100.070.41
(0.03)
0.440.390.18
(0.01)
0.180.17
520.39
(0.01)
0.400.380.45
(0.01)
0.460.440.47
(0.05)
0.510.420.14
(0.04)
0.180.100.41
(0.02)
0.430.390.15
(0.03)
0.170.12
610.33
(0.08)
0.420.260.37
(0.11)
0.490.290.43
(0.07)
0.500.360.10
(0.05)
0.150.060.44
(0.02)
0.460.420.14
(0.02)
0.150.12
620.38
(0.04)
0.420.340.47
(0.06)
0.540.420.45
(0.01)
0.450.440.16
(0.03)
0.180.120.44
(0.02)
0.460.420.16
(0.06)
0.220.11
Table 3. Descriptive statistics of the number of communities, number of maximal cliques, and largest clique size over the 3 days for the early and late growing periods.
Table 3. Descriptive statistics of the number of communities, number of maximal cliques, and largest clique size over the 3 days for the early and late growing periods.
PenPeriodNo. of CommunitiesNo. of Maximal CliquesLargest Clique Size
Mean (SD)MaxMinMean (SD)MaxMinMean (SD)MaxMin
114.0 (1.0)5.03.027.7 (4.7)33.024.05.3 (0.6)6.05.0
23.0 (0.0)3.03.020.0 (6.2)25.013.06.7 (1.2)8.06.0
213.0 (1.00)4.02.029.0 (2.0)31.027.05.7 (0.6)6.05.0
23.7 (0.60)4.03.026.0 (7.2)34.020.05.3 (0.6)6.05.0
313.3 (0.60)4.03.024.0 (2.0)26.022.05.3 (0.6)6.05.0
23.3 (0.60)4.03.016.0 (5.3)22.012.05.3 (1.2)6.04.0
414.0 (0)4.04.024.3 (3.1)27.021.06.3 (0.6)7.06.0
23.0 (0)3.03.024.7 (2.1)27.023.05.0 (1.0)6.04.0
513.7 (0.6)4.03.032.0 (3.5)34.028.05.3 (0.6)6.05.0
23.7 (0.6)4.03.025.3 (2.5)28.023.05.7 (0.6)6.05.0
613.0 (0)3.03.033.7 (2.5)36.031.05.3 (0.6)6.05.0
23.3 (0.6)4.03.020.0 (2.0)22.018.06.7 (0.6)7.06.0
Table 4. Descriptive statistics for the individual SNA traits of the studied pens for early and late growing periods.
Table 4. Descriptive statistics for the individual SNA traits of the studied pens for early and late growing periods.
TraitEarly Growing PeriodLater Growing Period
Mean (SD)MaxMinMean (SD)MaxMin
Individual degree centrality0.42 (0.16)0.8300.42 (0.18)0.900.06
Individual closeness centrality0.02 (0.001)0.0300.03 (0.01)0.050.01
Individual betweenness centrality0.04 (0.04)0.2300.04 (0.05)0.290.00
Individual eigenvector centrality0.56 (0.24)1.0000.53 (0.26)1.000.04
Individual clustering coefficient0.55 (0.17)1.0000.60 (0.20)1.000.00
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Agha, S.; Psota, E.; Turner, S.P.; Lewis, C.R.G.; Steibel, J.P.; Doeschl-Wilson, A. Revealing the Hidden Social Structure of Pigs with AI-Assisted Automated Monitoring Data and Social Network Analysis. Animals 2025, 15, 996. https://doi.org/10.3390/ani15070996

AMA Style

Agha S, Psota E, Turner SP, Lewis CRG, Steibel JP, Doeschl-Wilson A. Revealing the Hidden Social Structure of Pigs with AI-Assisted Automated Monitoring Data and Social Network Analysis. Animals. 2025; 15(7):996. https://doi.org/10.3390/ani15070996

Chicago/Turabian Style

Agha, Saif, Eric Psota, Simon P. Turner, Craig R. G. Lewis, Juan Pedro Steibel, and Andrea Doeschl-Wilson. 2025. "Revealing the Hidden Social Structure of Pigs with AI-Assisted Automated Monitoring Data and Social Network Analysis" Animals 15, no. 7: 996. https://doi.org/10.3390/ani15070996

APA Style

Agha, S., Psota, E., Turner, S. P., Lewis, C. R. G., Steibel, J. P., & Doeschl-Wilson, A. (2025). Revealing the Hidden Social Structure of Pigs with AI-Assisted Automated Monitoring Data and Social Network Analysis. Animals, 15(7), 996. https://doi.org/10.3390/ani15070996

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop