quoll

s41598-023-48551-1

file

file:///home/pi/welfare_docs/Animals Assured/Research/Pig Castrate/s41598-023-48551-1.pdf

No contextual analysis available. Re-ingest with quoll add -f <path> to generate claim analysis, evidence mapping, and other enrichments.

Full text
1 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Simplified assessment of castration‑induced pain in pigs using lower complexity algorithmsGustavo Venâncio da Silva 1, Giovana Mancilla Pivato 1, Beatriz Granetti Peres 1, Stelio Pacca Loureiro Luna 2, Monique Danielle Pairis‑Garcia 3 & Pedro Henrique Esteves Trindade 1,3*Pigs are raised on a global scale for commercial or research purposes and often experience pain as a by product of management practices and procedures performed. Therefore, ensuring pain can be effectively identified and monitored in these settings is critical to ensure appropriate pig welfare. The Unesp‑Botucatu Pig Composite Acute Pain Scale (UPAPS) was validated to diagnose pain in pre‑weaned and weaned pigs using a combination of six behavioral items. To date, statistical weighting of supervised and unsupervised algorithms was not compared in ranking pain‑altered behaviors in swine has not been performed. Therefore, the aim of this study was to verify if supervised and unsupervised algorithms with different levels of complexity can improve UPAPS pain diagnosis in pigs undergoing castration. The predictive capacity of the algorithms was evaluated by the area under the curve (AUC). Lower complexity algorithms containing fewer pain‑altered behaviors had similar AUC (90.1–90.6) than algorithms containing five (89.18–91.24) and UPAPS (90.58). In conclusion, utilizing a short version of the UPAPS did not influence the predictive capacity of the scale, and therefore it may be easier to apply and be implemented consistently to monitor pain in commercial and experimental settings.Pigs (Sus scrofa domesticus) are raised worldwide for commercial or research purposes1,2. During their lifetime, pigs are routinely submitted to painful procedures3,4, with castration commonly performed on most male pigs in commercial and research settings to improve meat quality and reduce the risk of injury associated with aggression5,6. Despite the immunocastration raising popularity in the global swine industry7, studies estimated that 61% of European male pigs8 and up to 94 million male piglets in the United States9 are surgically castrated annually. In a production context, painful conditions such as surgical castration can decrease performance and result in poor weight gain10, while in experimental frameworks, pain experienced by the animal can add bias to the scienti c research results11. Regardless of either scenario, the pig s welfare is compromised thus presenting an ethical and legal dilemma11 that needs to be addressed both on-farm and in the laboratory4,12.Pain is de ned as an unpleasant sensory and emotional experience associated with actual or potential tissue damage, or described in terms of such damage 13. For humans, the gold-standard method for pain assessment is through self-reporting14, however, in non-verbal animals, such as swine, methods to assess pain vary and include deviations to the animal s physiological (e.g. infrared thermography15, cortisol16 and prostaglandin-217) and behavioral response to post-painful procedure (e.g. pain scales18 21, time budget16,22 27, frequency of pain-associated behavioral expression16,24,27 29). Behavioral pain assessment is considered more favorable given it is non-intrusive, non-invasive, cost-e ective, and easier to assess across diverse farm or laboratory settings17. However, many veterinarians and farmers struggle with pain assessment in pigs30,31. In a previous study, 32.8% of farmers and 40.4% veterinarians agreed that it is di cult to recognise pain in pigs 3, and in other, only 32% of canadian veterinarians considered to have an adequate knowledge of analgesia in pigs31. To help mitigate this challenge, pain scales such as the Unesp-Botucatu Pig Composite Acute Pain Scale (UPAPS) have been developed based on pain-altered behaviors18 and validated as means to assess pain states a er surgical castration using OPEN 1Laboratory of Applied Artificial Intelligence in Health (LAAIH), Department of Anesthesiology, Botucatu Medical School, São Paulo State University (Unesp), Botucatu, São Paulo, Brazil. 2Department of Veterinary Surgery and Animal Reproduction, School of Veterinary Medicine and Animal Science, São Paulo State University (Unesp), Botucatu, São Paulo, Brazil. 3Global Production Animal Welfare Laboratory, Department of Population Health and Pathobiology, College of Veterinary Medicine, North Carolina State University (NCSU), Raleigh, NC, USA. *email: pesteve@ncsu.edu; pedro.trindade@unesp.br 2 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 recorded videos18,19. Currently, the UPAPS is composed of either ve (pre-weaned pigs) or six (weaned pigs) behavioral items categorized further into four scores18,19.Despite the advantages of the behavior-based pain scales in recognized animals pain, its use can be laborious particularly when the scale relies on several pain-altering behavioral items to be assessed simultaneously. Pain scales for humans and other species have bene ted from statistical weightings and improvements suggested by supervised and unsupervised algorithms32 35 to identify what behavioral items are more responsive (altered) than others. Supervised algorithms require a response variable to adjust the algorithm to account for conditions, such as painful or pain-free, while unsupervised algorithms do not use a response variable36. ese algorithms were used to rank behaviors of importance, which can result in not only improvements to the scale itself but may improve the veterinarians and farmers experience assessing pain when accomplished in a more e cient, less time-consuming and simple manner.Recently, our research team has demonstrated the weighted importance of pain-altered facial expression in horses using principal component analysis (unsupervised algorithm)35, in sheep using binomial multilevel logistic regression and random forest32 and in swine using binomial multilevel logistic regression (supervised algorithms)34. To date, no studies have been conducted in swine comparing supervised and unsupervised algo-rithms for weighting of pain-altered behaviors across ages (pre-weaned and weaned) and no work has compared the accuracy of multiple algorithms with di erent levels of complexity and variables. erefore, the aim of this study was to verify if supervised and unsupervised algorithms with di erent levels of complexity can improve UPAPS diagnosis in weaned and pre-weaned pigs undergoing castration. Our hypothesis was that lower com-plexity algorithms might improve UPAPS diagnosis.ResultsBinomial multiple logistic regression (LR)Logistic Regression algorithms indicated the signi cance of each pain-altered behavior contribution to the pain-free or painful condition. From 17 pain-altered behaviors of the UPAPS, the Full LR only had Wags Tail (wags tail continuously and intensely) with a signi cant contribution (p < 0.001) to the algorithm (Table 1), which was also the most important pain-altered behavior according to the Wald statistics of Full LR (Fig. 1a). A Re ned LR was then conducted to select the predictor variables for the best algorithm based on the best subsets technique using the Bayesian information criterion (BIC) as a ranking criterion. e BIC values were lower in Re ned LR (72.0) than in Full LR (142.5), demonstrating a better adjustment of the algorithm a er re nement. Six pain-altered behaviors were retained in the Re ned LR. Wags Tail (wags tail continuously and intensely), Posture 1 (changes posture with some discomfort), and Interaction 2 (occasionally moves away from the other animals, but accepts approaches and shows little interest in the surroundings) contributed signi cantly (p < 0.001) to the Re ned LR (Table 2), which were also the three most important pain-altered behaviors respectively (Fig. 1b). e three pain-altered behaviors related to activity were excluded in the Re ned LR. Table 1. Parameters of the full binomial multiple logistic regression algorithm. Pain-free (before castration) or painful (a er castration) condition was used as a predictive variable and dummy of each pain-altered behavior of the Unesp-Botucatu Pig Composite Pain Scale as predictor variables. ParametersEstimateStandard errorp-valueLinear coe cient (α) − 3.9280.711 < 0.001Slope coe cients (β) Posture 13.1892.3690.178 Posture 222.9264712.5140.996 Posture 38.42311,217.2600.999 Interaction 11.4981.1780.203 Interaction 28.0045.6480.156 Interaction 312.91813,083.7500.999 Activity 11.2181.1440.286 Activity 2 − 2.6145.5410.637 Activity 3 − 0.6334.9390.897 Li pelvic limb − 0.9954.2820.816 Scratching rubbing − 4.5714.9530.356 Walk away run15.1474682.1430.997 Sit with di culty0.1672.2160.939 Wags tail5.7681.272 < 0.001 Bite grill1.7171.01870.092 Head down21.6834119.6890.996 Di culty overcoming0.1185.0040.981 3 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Figure 1. Importance of the pain-altered behaviors of the Unesp-Botucatu Pig Composite Pain Scale based on (a) Full logistic regression, (b) Re ned logistic regression, (c) Full discriminant canonical analysis and (d) Re ned discriminant canonical analysis, (e) Full principal component analysis, and (f) Re ned principal component analysis. Table 2. Parameters of the re ned binomial multiple logistic regression algorithm. Pain-free (before castration) or painful (a er castration) condition was used as a predictive variable and dummy of each pain-altered behavior of the Unesp-Botucatu Pig Composite Pain Scale as predictor variables. ParametersEstimateStandard errorp-valuesLinear coe cient (α) − 3.0930.457 < 0.001Slope coe cients (β) Posture 15.0451.161 < 0.001 Posture 220.2213067.4210.995 Interaction 24.1941.241 < 0.001 Interaction 320.9974684.4590.996 Wags tail5.1801.153 < 0.001 Head down20.6882684.2480.993 4 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Discriminant canonical analysis (CDA)Full CDA was performed using the ve UPAPS items (Posture, Interaction, Activity, Attention and Miscellane-ous) as grouping variables as pain-free or painful condition as a response variable. Re ned CDA was performed using four UPAPS items, excluding the item Activity and using Condition as response variable. As Condition is a binomial variable, the algorithms generated only one canonical discriminant function, which accounted for 100% of variation in both cases. Miscellaneous item had the greater linear discriminant for both Full and Re ned CDA (0.80 in both algorithms), while in Full CDA the smaller linear discriminant was from Activity item (0.18) and in Re ned CDA it was from Attention item (0.22) (Fig. 1c and d).Principal component analysis (PCA)Full PCA was performed using the ve UPAPS items and ve principal components (PC) were generated. Horn s parallel analysis indicated only the retention of the rst principal component (PC1). e PC1 accounted for 72.45% of variance and eigenvalue of 3.62. For variance and eigenvalue of all principal components please see Table S1. e Interaction item had the higher loading value (0.47), while the Activity item had the lower (0.42) (Fig. 1e). Re ned PCA was performed using four UPAPS items, excluding the Activity item, generating four PCs. Horn s parallel analysis also indicated only the retention of the PC1. In this algorithm, PC1 accounted for 76.16% of variance and eigenvalue of 3.04. For variance and eigenvalue of all principal components please see Table S2. e Posture item had the higher loading value (0.52), while the Miscellaneous item had the lower (0.48) (Fig. 1f).Predictive capacityAll areas under the curve (AUCs) from receiver operating characteristic (ROC) curves generated from the algo-rithms output were above 90%, except for Re ned LR that was 89.18% (Table 3). No algorithm was statistically di erent from UPAPS by DeLong test (p > 0.05). Sensitivity estimates (median) ranged from 0.88 to 0.90, while speci city estimates (median) ranged from 0.86 to 0.90.DiscussionCastration-induced pain is a critical welfare issue that can be a legal and ethical obligation for swine used for research and husbandry purposes and evaluating deviations to the pig s behavioral response is an e ective means to diagnosing pain accurately17. Unesp-Botucatu Pig Composite Acute Pain Scale (UPAPS) is a species-speci c tool developed for assessing swine pain and has been validated for use in weaned18 and pre-weaned pigs19 under-going castration. Because simultaneous assessment of multiple pain-altering behaviors may be di cult, we used statistical weightings to graduate the importance of behavioral items to facilitate using the scale. erefore, we investigated if supervised and unsupervised algorithms with di erent levels of complexity improved UPAPS diagnosis across weaned and pre-weaned pigs. is study utilized LR, CDA and PCA algorithms to assess the importance of pain-altered behaviors used in the UPAPS. e results from this study demonstrated that lowering algorithm complexity by removing the Activ-ity item preserved the predictive capacity when applying the weightings using CDA and PCA. ese techniques generated parameters that were applied to ranking pain-altered behaviors and all Re ned algorithms had statisti-cally similar AUC to Full algorithms with an AUC above 89%. Activity item comprises behavioral responses that are increased in painful conditions in some studies17,28 and decreased in another37. Additionally, younger pigs are less a ected behaviorally by castration-induced pain than older ones38. Activity behaviors as described in UPAPS are known to rely on housing conditions, which depends on both the animal facility structure and/or guidelines and on animals age39. ese three factors might explain why Activity pain-altered behaviors were consistently less important in some algorithms when two datasets including weaned and pre-weaned pigs were merged. Another explanation for the apparent less importance of the Activity item is overlapping with pain-altered behaviors in Posture and Interaction items, which might be caused by description similarities18,23. e Activity item was considered with satisfactory consistency, inter- and intra-observer reliability in previous studies18,19. In a recent study, Activity pain-altered behaviors had high statistical importance34. We reasoned that this might be caused by Table 3. Area under the curve (AUC) from receiver operating characteristic (ROC) curves of each algorithm and the Unesp-Botucatu Pig Composite Pain scale. Data are presented as median (95% con dence interval). AUC was compared based on DeLong test. LR binomial multiple logistic regression, PCA principal component analysis, CDA canonical discriminant analysis, NA not applied. P-value refers to DeLong test, applied to compare AUC between the speci ed ROC curve and Unesp-Botucatu Pig Composite Pain Scale ROC curve. ROC curveAUC (%)p-value (UPAPS vs) resholdSensitivitySpeci cityUPAPS90.58 (84.32 96.84)NA2.50 (1.50 3.50)0.90 (0.8 0.98)0.88 (0.78 0.98)UPAPS without activity91.24 (85.33 97.15)0.3172.00 (1.50 2.50)0.90 (0.78 0.96)0.88 (0.78 0.96)Full LR90.6 (84.57 96.63)0.9800.86 (0.15 0.88)0.88 (0.78 0.98)0.90 (0.76 0.98)Re ned LR89.18 (82.72 95.64)0.3580.40 (0.40 0.99)0.90 (0.76 0.98)0.86 (0.74 0.94)Full PCA91.32 (85.29 97.35)0.2710.92 (0.45 1.32)0.90 (0.80 0.98)0.90 (0.80 0.98)Re ned PCA91.52 (85.60 97.44)0.1291.01 (0.50 1.48)0.90 (0.80 0.98)0.90 (0.80 0.98)Full CDA90.56 (84.45 96.67)0.9820.86 (0.86 1.42)0.90 (0.78 0.98)0.88 (0.76 0.96)Re ned CDA90.12 (83.80 96.44)0.6030.93 (0.93 1.45)0.90 (0.78 0.98)0.88 (0.76 0.96) 5 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 methodological di erences. In previous studies of weighting UPAPS castration-induced pain-altered behaviors, the response variable was the observer analgesia indication34, while in ours it is the condition (painful or pain-free). Altogether, such pieces of evidence suggest the removal of the Activity item from UPAPS when applying the weightings by CDA or PCA across ages for diagnosing castration-induced pain. is speci c nding also gave us the insight that the importance of each pain-altered behavior might not be closely related to consistency or observer reliability, and the relationship between them could be investigated in the future.Posture and Interaction items were consistently important for all algorithms. In Re ned LR, two out of three pain-altered behaviors with a signi cant slope coe cient were from Posture and Interaction items. Both CDA discriminant coe cients and PCA loading values also indicated Posture and Interaction items as one of the most important items of the UPAPS. Posture and Interaction items comprise castration-induced pain-altered behaviors that are similar to behaviors found to be altered in other studies23,25,28,37,38 thus supporting their importance. In a previous study, where UPAPS was weighted following a binomial multilevel logistic regression using a weaned pigs dataset, Posture and Interaction behaviors were also of high importance34.In LR and CDA algorithms, Miscellaneous item (CDA) or its individual pain-altered behaviors (LR) were indicated as one of the most important, while in PCA, this item was one of the least important. is di erence can be partially explained due to LR and CDA being supervised techniques, in other words, it uses a response variable, while PCA is an unsupervised technique, it does not need a response variable36. Since PCA loading values may be interpreted as the amount of variance that a variable had40, we might argue that Miscellaneous pain-altered behaviors varied less than the other ones, but when it occurred, it contributed signi cantly to the response variable outcome. Miscellaneous pain-altered behaviors are likely correlated with the response variable shi (painful and pain-free condition) and this can be partially explained because it is composed of behaviors related to castration-induced pain or discomfort, while part of the other UPAPS items are related to maintenance behaviors that can or cannot be altered when the pig is experiencing pain. ese results reinforce the need for the comparison between techniques, as demonstrated on sheep32. In addition, because the majority of validation steps are unsupervised techniques, future re nement and validation processes may bene t from the use of LR and CDA, as suggested previously41.Changes in UPAPS were expected since this is the rst time a supervised algorithm was applied to weight the castration-induced pain-altered behaviors of the scale using a dataset of weaned and pre-weaned piglets. In Full LR algorithm, only the slope coe cient from the Wags Tail behavior was statistically signi cant, while there were other slope coe cients that had negative estimates. ese results combined suggest a poor adjustment of the algorithm, which supported a re nement in which pain-altered behaviors should be considered. Re ned LR had the lowest BIC combination of pain-altered behaviors and it was the best-adjusted algorithm. Also in Re ned LR, we found three pain-altered behaviors with low Wald statistics and high standard error: Posture 2 (Changes posture, with discomfort, and protects the a ected area), Head Down and Interaction 3 (Moves or runs away from other animals and does not allow approaches; disinterested in the surroundings). Considering that Re ned LR was the best-adjusted algorithm, these three items might occur in agreement with the response variable. is study is not free of limitations. First, all studies in pain-altered behavior must face the fact that in some species, the pain perception threshold is altered by negative a ective states, such as anxiety and distress4. In agreement with that, there are no behaviors that exclusively address pain, but the assessment of pain-altered behaviors substantially contributes to identifying pain42. In our study, some dissimilarities in housing might a ect the behavior response43. Also, UPAPS Appetite item was not considered because it had no statistical signi cance in our previous study34, however, altered feeding behavior was reported in another research as a pain indicator for pre-weaned piglets44. Another limitation of this study was the unbalanced number of pigs in each dataset. Although there was not a sign of under tting according to AUC, sensitivity and speci city of the algorithms, further studies could increase the sample size. In addition, the di erence in the pain control protocol between the databases due to the legislation for each host country represents a study limitation. Lastly, timing of obser-vations was slightly di erent between the two datasets merged in the current study, however, they represent the same conditions.Realistically, this study might improve the practice of veterinarians who consider their knowledge not suf- cient for assessing pain in pigs31 or for farmers and veterinarians who nd this evaluation di cult30, although this was not tested yet. e AUC from UPAPS original weighting without the Activity item was statistically similar to the full UPAPS, which supports a shorter version of the scale. A shorter version of UPAPS may be easier to apply with fewer items, increasing the chance for its employment and regular use in commercial and experimental contexts. Our study considered surgical castration-induced pain to re ne the UPAPS, however, some UPAPS pain-altered behaviors are related to the surgical areas, and the scale also might be helpful for pain diagnosing due to surgeries performed in the same area of the pig body. Also, UPAPS maintenance behaviors might be a general contribution for pain recognition from other sources. ese two points may be relevant since the UPAPS pain-altered behaviors are easily recognizable by evaluators in the tutorial videos on the Animal Pain webpage (https:// anima lpain. org/ en/ home- en/). Both extrapolations of our ndings require to be tested by clini-cal studies assessing multiple painful conditions, however, it is very likely that in other contexts, with di erent types, areas, durations and or intensities of pain, the UPAPS would need further adaptations that could employ the same rationale used in the present study.Behavioral methods for assessing pain such as UPAPS are essential in recognizing and quantifying pain in animals45 and therefore their shortening and usability re nement contributes not only to improving pig pain diagnosis but also to welfare. e average time to score original and shortened UPAPS as well as the potential gain of accuracy of the shortened UPAPS should be assessed in future studies. Yet, the shortened scale might be used for developing so ware that automates pain diagnosis. e present study also reinforces the importance of employing supervised and unsupervised algorithms to rank pain-altered behaviors. 6 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 We concluded that lowering the complexity of supervised and unsupervised algorithms for the statistical weighting of UPAPS is bene cial and helped to identify important behaviors and suggest a potential more e cient acute pain scale to be used in piglets undergoing surgical castration with no impairment in predictive capacity. Further studies might con rm or not our ndings by monitoring piglets pain in a real-world setting.MethodsIn the current study data was obtained from two previous publications18,19. e rst study was approved by the Ethical Committee for the Use of Animals in Research of the School of Veterinary Medicine and Animal Sci-ence, Unesp, Botucatu, Brazil, under protocol number 102/2014 and followed the Brazilian Federal legislation of National Council for the Control of Animal Experimentation (CONCEA)18. e second study was approved by the North Carolina State University Animal Care and Use Committee under protocol number 19-79619. Both previous publications and the current study followed ARRIVE guidelines for animal research reports46. Together, both datasets were used as our database as we understand that data reuse contributes to two of the four R s of animal research (reduce and responsibility)47,48.DatasetsWeaned pigs dataset18 comprised behavioral observations of pigs in pre- and post-castration timepoints. ere were 45 Landrace, Large White, Duroc and Hampshire male pigs randomly selected from the university com-mercial production. e animals were aged 38 + 3 days and weighed 11.06 + 2.28 kg, and were housed in iron pens (2.40 × 1.50 × 1.50 m of length x width x height) located side by side separated by bars in groups of ve pigs. Before the surgery, pigs were submitted to bilateral local anesthesia with 0.5 mL of 1% lidocaine without vasoconstrictor (Xylestesin®, Cristália, Itapira, São Paulo, Brazil) injected subcutaneously at each incision line, parallel to the scrotum sha , followed by 1 mL injected intratesticularly at each testicle, and the surgery was per-formed a er ve minutes. Surgical castration was always performed by the same trained surgeon. Details about surgical procedures and housing conditions were described in the previous study18. e pigs were recorded from 24 to 16 h before surgery (pain-free condition), 3.5 to 4 h a er surgery (pain condition), and other timepoints from which observations were not used in this study. In each timepoint, animals were evaluated for at least four minutes. All video recordings were assessed by three observers according to UPAPS. ey were referred to as Gold Standard, Observer 1 and Observer 2 in the original paper15. In the original study, all observers assessed all videos (phase 1) and repeated all video assessments a er an interval (phase 2) due to psychometric validation steps, however, we used only the rst phase of the assessment to merge two datasets, since in the second dataset (described below) was performed only one assessment phase.Pre-weaned pigs dataset19 comprised behavioral observations of piglets in pre- and post-castration timepoints. ere were 39 Yorkshire-Landrace x Duroc piglets enrolled in the study. e animals were aged ve days and weighed 1.62 ± 0.23 kg, housed with sows in individual farrowing crates (0.8 × 2.3 m of length x width) in fully slatted oors in a farrowing room with controlled environment conditions. General or local anesthesia was not administered, as it is standard practice in the United States and the procedure followed the standard operating procedure approved by the attending veterinarian. All male piglets at this facility underwent castration prior to weaning, therefore the castration procedure would have occurred regardless of the research. Surgical castration was always performed by the same trained surgeon. Details about surgical procedures and housing conditions were described in the previous study19. However, all piglets enrolled in Pre-weaned pigs dataset did receive intramuscular unixin meglumine (2.2 mg/kg unixin meglumine IM; Merck Animal Health, Millsboro, DE, US) one hour a er surgery. e animals were recorded at 24 h before surgery (pain-free condition), 15 min a er surgery (pain condition), and other timepoints from which observations were not used in this study. e animals were recorded and video clips of 4 min were obtained. Some piglets were asleep, so we only considered assess-ments of awake piglets (n = 14). All video recordings were assessed by two observers in a single assessment phase.First, both datasets were split separately into (i) a train set comprising 70% of pigs (31 weaned and 10 pre-weaned) selected randomly, used for algorithm tting, and (ii) a test set with 30% of reminiscent pigs (14 weaned and 4 pre-weaned), used for algorithm predicting. Following, train and test sets from weaned and pre-weaned pigs datasets were merged. en, both train and test sets contained ve observers, two perioperative timepoints, and two age groups, changing the number of pigs and consequently the number of observations (410 and 180, respectively 70 and 30%).Pain‑altered behavior scaleIn the UPAPS, six behavioral items regarding posture, interaction and interest in the surroundings, activity, appe-tite (for weaned pigs), attention to the a ected area and miscellaneous behaviors are assessed. ese behavioral items are descriptive and composed by four score levels: 0 , 1 , 2 and 3 , according to the presence or absence of pain-related behaviors (Table 4). In the UPAPS validation for pre-weaned pigs, the nursing behavior would be analogous to the appetite in weaned pigs, but Nursing item was disregarded for pre-weaned piglets19. In order to merge the databases, the appetite and nursing items were disregarded. en, the total sum of the ve behavioral items scores (0 15) were considered to assess pain.Statistical descriptionAll statistical procedures were performed in R language, using RStudio integrated development environment49 (Version 4.2.2; RStudio, Inc., Boston, MA, USA). e functions and packages were presented in the format package::function . p-values were considered signi cant when p ≤ 0.05 in all tests. Figures were colored using a color palette distinguishable for common kinds of colorblindness (ggplot2::scale_colour_viridis_d). 7 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Multilevel binomial logistic regression (LR)Logistic Regression is a classi cation technique widely used for di erent purposes50. In this study, we used it to compute the respective probability of each observation (pain assessment) on being classi ed as pain or pain-free condition. A full algorithm (Full LR), containing all predictor variables was created, and used as reference for an automated algorithm selection (glmulti::glmulti) referred to as best subsets technique. is technique nds the best candidate algorithms with optimized information criteria. To select the best subset of predictors, we considered the Bayesian information criterion (BIC), which penalizes the predictor inclusion, and therefore it contributes to nding the better tting with less predictor s algorithms. An exhaustive search was used to nd the exact solution. e best BIC algorithm is referred to as Re ned LR.Both Full LR and Re ned LR followed the same procedures. Algorithms were created in the train set using stats::glm, using condition as response variable (0 = absence of pain, corresponding to M1; and 1 = presence of pain, corresponding to M2). e behavioral items from UPAPS were converted into dummy variables (0 = absence and 1 = presence of each behavior) (fastDummies::dummy_columns), and then used as predictor variables. A er algorithm tting, the event probability of occurring (Condition classi cation as 1) was computed for each observation in the test set (stats::predict). Wald statistics generated from the algorithms were used to rank behaviors, as proposed previously34.Canonical discriminant analysis (CDA)Canonical Discriminant Analysis is a variation of the linear discriminant analysis with the related Fisher s linear discriminant method. It nds a linear combination of features that may be used as a classi er or dimensionality reduction before classi cation51. In this study, we adapted CDA to use a binomial response variable, rather than a multiclass variable, and performed it to compare its classi cation along with binomial multiple logistic regres-sion (LR) and principal component analysis (PCA, described next). A Full CDA, with all ve items as variables, and a Re ned CDA, without Activity item, were performed. Activity was withdrawn because the best subsets technique for LR indicated the removal of all pain-altered behaviors related with Activity, so it was needed for a fair comparison. Both Full and Re ned CDA followed the same procedures. Table 4. Unesp-Botucatu Pig Composite Pain Scale system without appetite or nursing item18,19. ItemScoreScore/criterionLinks to videosPosture0Normal (any position, apparent comfort, relaxed muscles) or sleepinghttps:// youtu. be/ QSosC D2SD4E1Changes posture, with discomforthttps:// youtu. be/ SpaWs FCrPxE2Changes posture, with discomfort, and protects the a ected areahttps:// youtu. be/ VjSls RrG8yA3Quiet, tense, and back archedhttps:// youtu. be/ pm4hJ 5163aoInteraction and interest in the surroundings0Interacts with other animals; interested in the surroundings or sleepinghttps:// youtu. be/- 880ST gYq2I1Only interacts if stimulated by other animals; interested in the surroundingshttps:// youtu. be/ nXjOd wn3dyw2Occasionally moves away from the other animals, but accepts approaches; shows little interest in the surroundingshttps:// youtu. be/ 2k2JD r5U6As3Moves or runs away from other animals and does not allow approaches; disinterested in the surroundingshttps:// youtu. be/ se70o YXcWFwActivity0Moves normally or sleepinghttps:// youtu. be/ cC75t 7L5- YA1Moves with less frequencyhttps:// youtu. be/ lQo9w q8LAn82Moves constantly, restlesshttps:// youtu. be/ YQRJj ijLvpk3Reluctant to move or does not movehttps:// youtu. be/ Zyx0G 3Wpt8oAttention to the a ected areaA. Elevates pelvic limb or alternates the support of the pelvic limbhttps:// youtu. be/ UD99 O7HE0B. Scratches or rubs the painful areahttps:// youtu. be/ 7idfF k1harEC. Moves and/or runs away and/or jumps a er injury of the a ected areahttps:// youtu. be/u- Pqubo m278D. Sits with di cultyhttps:// youtu. be/ ETNEO CVV4h00All the above behaviors are absent1Presence of one of the above behaviors2Presence of two of the above behaviors3Presence of three or all the above behaviorsMiscellaneous behaviorsA. Wags tail continuously and intenselyhttps:// youtu. be/ pU5dG ZFNRHcB. Bites the bars or objectshttps:// youtu. be/ cF3ds q7gMtkC. e head is below the line of the spinal columnhttps:// youtu. be/ ZcIgn gclRpID. Presents di culty in overcoming obstacles (example: another animal)https:// youtu. be/ HlvdO I3lGuY0All the above behaviors are absent1Presence of one of the above behaviors2Presence of two of the above behaviors3Presence of three or all the above behaviors 8 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Canonical discriminant analysis was performed using Condition as grouping factor and UPAPS behavioral items scores as discriminators, using MASS::lda in the train set. Coe cients of linear discriminants were used to predict the probability of presence of pain (Condition = 1) in each observation of the test set. e discriminant coe cients were used as CDA weightings to obtain a new total score. For this purpose, each UPAPS item was multiplied by its respective CDA weighting (discriminant coe cient), resulting in a new score for each item. e new scores were added, resulting in a new total score for Full CDA and for Re ned CDA. Discriminant coe cients generated from the algorithms were also used to rank behavioral items, as proposed previously52.Principal component analysis (PCA)Principal component analysis was used as an unsupervised comparison to supervised technique (logistic regres-sion and canonical discriminant analysis). Principal Component Analysis is a dimensionality reduction technique that retains data variation that also might be used for testing the multiple association between variables53. It is performed by reducing the number of variables into principal components (PCs), where the data variation is maximal40. Similarly to CDA, a Full PCA and a Re ned PCA without Activity, for the same reason, were per-formed and followed the same procedures described in this section. e number of PCs retained was de ned by Horn s parallel analysis using psych::fa.parallel on the train set. is method compares the factors scree of the observed data to a randomly generated one, of a data matrix of the same size as ours. e correlation matrix used Pearson correlation. e method was computed a er 1,001 simulated analyses performed.PCA was then performed (stats::princomp) on the train set. Eigean values were calculated using the standard deviation of the principal components. Loading values were obtained using stats::loadings. e loading values were used to mutate the original scores in the test set, resulting in a new total score based on PCA weightings. e loading values were used as PCA weightings to obtain a new total score. For this purpose, each UPAPS item was multiplied by its respective PCA weighting (loading value), resulting in a new score for each item. e new scores were added, resulting in a new total score for Full PCA and for Re ned PCA.Loading values generated from the algorithms were also used to rank behavioral items, as proposed previously35.Predictive capacity e area under the curve (AUC) from receiver operating characteristic (ROC) curve is a widely used technique to evaluate the performance of a binary classi er system as its discrimination threshold varies54. A ROC curve was generated using the Condition classes (pain and free-pain) as a predictor variable and each one of the six algorithms predicted in the test set, using pROC::ROC. It was also generated a ROC curve using UPAPS original scores and UPAPS scores without the Activity item. is function returns the AUC and its respective con -dence interval. Furthermore, threshold, sensitivity, sensibility, and their respective 95% of con dence intervals were obtained for each ROC curve using pROC::ci.coords. reshold was calculated using the Youden method. Both ROC and its coordinates were generated using 95% of con dence and bootstrapping strati cation of 1001 replicates.DeLong test was used to compare the AUCs generated from UPAPS and each algorithm. If more than one algorithm was detected as di erent from UPAPS, they were tested between them. DeLong test was performed using pROC::roc.test.Data availabilityWeaned pigs dataset18 and Pre-weaned pigs dataset19 were already publicly available in the supplementary mate-rial of their respective publications. Also, merged datasets analyzed during this study and the R script were included in its supplementary information les.Received: 25 August 2023; Accepted: 28 November 2023 References 1. Food and Agriculture Organization of the United Nations. Meat Market Review - Emerging trends and outlook (2022). 2. Bergen, W. G. Pigs (Sus Scrofa) in biomedical research. Adv. Exp. Med. Biol. 1354, 335 343 (2022). 3. Ison, S. H., Clutton, R. E., Di Giminiani, P. & Rutherford, K. M. D. A review of pain assessment in pigs. Front. Vet. Sci. https:// doi. org/ 10. 3389/ fvets. 2016. 00108 (2016). 4. Steagall, P. V., Bustamante, H., Johnson, C. B. & Turner, P. V. Pain management in farm animals: Focus on cattle sheep and pigs. Animals (Basel) 11, 1483 (2021). 5. von Borell, E. et al. Animal welfare implications of surgical castration and its alternatives in pigs. Animal 3, 1488 1496 (2009). 6. Bonneau, W. Pros and cons of alternatives to piglet castration: Welfare, boar taint, and other meat quality traits. Animals 9, 884 (2019). 7. Čandek-Potokar, M., krlep, M. & Zamaratskaia, G. Immunocastration as Alternative to Surgical Castration in Pigs (InTech, 2017). https:// doi. org/ 10. 5772/ intec hopen. 68650. 8. De Briyne, N., Berg, C., Blaha, T. & Temple, D. Pig castration: Will the EU manage to ban pig castration by 2018?. Porcine Health Manag. 2, 29 (2016). 9. Wagner, B., Royal, K., Park, R. & Pairis-Garcia, M. Identifying barriers to implementing pain management for piglet castration: A focus group of swine veterinarians. Animals (Basel) 10, 1202 (2020). 10. Telles, F. G., Luna, S. P. L., Teixeira, G. & Berto, D. A. Long-term weight gain and economic impact in pigs castrated under local anaesthesia. Vet. Anim. Sci. 1 2, 36 39 (2016). 11. Carbone, L. Pain in laboratory animals: e ethical and regulatory imperatives. PLoS One 6, e21578 (2011). 12. Grethe, H. e economics of farm animal welfare. SSRN Sch. Pap. https:// doi. org/ 10. 1146/ annur ev- resou rce- 100516- 053419 (2017). 9 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 13. Raja, S. N. et al. e revised International Association for the Study of Pain de nition of pain: Concepts, challenges, and compro-mises. Pain 161, 1976 1982 (2020). 14. Schiavenato, M. & Craig, K. Pain assessment as a social transaction beyond the gold standard . Clin. J. Pain 26, 667 676 (2010). 15. Whittaker, A. L. et al. Assessment of pain and in ammation in domestic animals using infrared thermography: A narrative review. Animals 13, 2065 (2023). 16. Sutherland, M. A., Backus, B. L., Brooks, T. A. & McGlone, J. J. e e ect of needle-free administration of local anesthetic on the behavior and physiology of castrated pigs. J. Vet. Behav. 21, 71 76 (2017). 17. Baysinger, A. et al. Proposed multidimensional pain outcome methodology to demonstrate analgesic drug e cacy and facilitate future drug approval for piglet castration. Anim. Health Res. Rev. 22, 163 176 (2021). 18. Luna, S. P. L. et al. Validation of the UNESP-Botucatu pig composite acute pain scale (UPAPS). PLoS One 15, e0233552 (2020). 19. Robles, I. et al. Validation of the Unesp-Botucatu pig composite acute pain scale (UPAPS) in piglets undergoing castration. PLoS One 18, e0284218 (2023). 20. Viscardi, A. V., Hunniford, M., Lawlis, P., Leach, M. & Turner, P. V. Development of a piglet grimace scale to evaluate piglet pain using facial expressions following castration and tail docking: A pilot study. Front. Vet. Sci. 4, 51 (2017). 21. Navarro, E., Mainau, E. & Manteca, X. Development of a facial expression scale using farrowing as a model of pain in sows. Animals 10, 2113 (2020). 22. Carroll, J. A., Berg, E. L., Strauch, T. A., Roberts, M. P. & Kattesh, H. G. Hormonal pro les, behavioral responses, and short-term growth performance a er castration of pigs at three, six, nine, or twelve days of age1,2. J. Anim. Sci. 84, 1271 1278 (2006). 23. Hay, M., Vulin, A., Génin, S., Sales, P. & Prunier, A. Assessment of pain induced by castration in piglets: Behavioral and physi-ological responses over the subsequent 5 days. Appl. Anim. Behav. Sci. 82, 201 218 (2003). 24. Leidig, M. S., Hertrampf, B., Failing, K., Schumann, A. & Reiner, G. Pain and discomfort in male piglets during surgical castration with and without local anaesthesia as determined by vocalisation and defence behaviour. Appl. Anim. Behav. Sci. 2 4, 174 178 (2009). 25. McGlone, J. J., Nicholson, R. I., Hellman, J. M. & Herzog, D. N. e development of pain in young pigs associated with castration and attempts to prevent castration-induced behavioral changes. J. Anim. Sci. 71, 1441 1446 (1993). 26 Morrison, R. & Hemsworth, P. Tail docking of piglets 2: E ects of meloxicam on the stress response to tail docking. Animals (Basel) 10, 1699 (2020). 27. Sutherland, M. A., Davis, B. L., Brooks, T. A. & Coetzee, J. F. e physiological and behavioral response of pigs castrated with and without anesthesia or analgesia1. J. Anim. Sci. 90, 2211 2221 (2012). 28. Sutherland, M. A., Davis, B. L., Brooks, T. A. & McGlone, J. J. Physiology and behavior of pigs before and a er castration: E ects of two topical anesthetics. Animal 4, 2071 2079 (2010). 29. Torrey, S., Devillers, N., Lessard, M., Farmer, C. & Widowski, T. E ect of age on the behavioral and physiological responses of piglets to tail docking and ear notching. J. Anim. Sci. 87, 1778 1786 (2009). 30. Ison, S. H. & Rutherford, K. M. D. Attitudes of farmers and veterinarians towards pain and the use of pain relief in pigs. Vet. J. 202, 622 627 (2014). 31. Hewson, C. J., Dohoo, I. R., Lemke, K. A. & Barkema, H. W. Canadian veterinarians use of analgesics in cattle, pigs, and horses in 2004 and 2005. Can. Vet. J. 48, 155 164 (2007). 32. Trindade, P. H. E., de Mello, J. F. S. R., Silva, N. E. O. F. & Luna, S. P. L. Improving ovine behavioral pain diagnosis by implementing statistical weightings based on logistic regression and random forest algorithms. Animals (Basel) 12, 2940 (2022). 33. Turner, D. et al. Mathematical weighting of the pediatric Crohn s disease activity index (PCDAI) and comparison with its other short versions. In amm. Bowel Dis. 18, 55 62 (2012). 34 Trindade, P. H. E., de Araújo, A. L. & Luna, S. P. L. Weighted pain-related behaviors in pigs undergoing castration based on mul-tilevel logistic regression algorithm. Appl. Anim. Behav. Sci. https:// doi. org/ 10. 1016/j. appla nim. 2023. 106002 (2023). 35. Carvalho, J. R. G. et al. Facial expressions of horses using weighted multivariate statistics for assessment of subtle local pain induced by polylactide-based polymers implanted subcutaneously. Animals (Basel) 12, 2400 (2022). 36 Alloghani, M., Al-Jumeily, D., Musta na, J., Hussain, A. & Aljaaf, A. J. A systematic review on supervised and unsupervised machine learning algorithms for data. Science https:// doi. org/ 10. 1007/ 978-3- 030- 22475-2_1 (2020). 37. Taylor, A. A., Weary, D. M., Lessard, M. & Braithwaite, L. Behavioural responses of piglets to castration: e e ect of piglet age. Appl. Anim. Behav. Sci. 73, 35 43 (2001). 38. McGlone, J. J. & Hellman, J. M. Local and general anesthetic e ects on behavior and performance of two- and seven-week-old castrated and uncastrated piglets. J. Anim. Sci. 66, 3049 3058 (1988). 39. Ludwiczak, A. et al. How housing conditions determine the welfare of pigs. Animals 11, 3484 (2021). 40. Ringnér, M. What is principal component analysis?. Nat. Biotechnol. 26, 303 304 (2008). 41 Streiner, D. L., Norman, G. R. & Cairney, J. Health Measurement Scales: A Practical Guide to eir Development and Use (Oxford University Press, 2015). 42. Prunier, A. et al. Identifying and monitoring pain in farm animals: A review. Animal 7, 998 1010 (2013). 43. Steybe, L., Kress, K., Schmucker, S. & Stefanski, V. Impact of housing condition on welfare and behavior of immunocastrated fat-tening pigs (Sus scrofa domestica). Animals 11, 618 (2021). 44 McGlone, J., Guay, K. & Garcia, A. Comparison of intramuscular or subcutaneous injections vs. castration in pigs impacts on behavior and welfare. Animals 6, 52 (2016). 45. Gigliuto, C. et al. Pain assessment in animal models: Do we need further studies?. J. Pain Res. 7, 227 236 (2014). 46 Percie Du Sert, N. et al. Reporting animal research: Explanation and elaboration for the ARRIVE guidelines 2.0. PLoS Biol. 18, e3000411 (2020). 47. Russell, W. M. S. & Burch, R. L. e Principles of Humane Experimental Technique (Methuen & Co., Ltd., 1959). 48. Banks, R. E. e 4th R of research. Contemp. Top. Lab. Anim. Sci. 34, 50 51 (1995). 49. R Core Team. R: A language and environment for statistical computing (2022). 50. Darlington, R. B. Regression and Linear Models (McGraw-Hill Companies, 1990). 51. Johnson, R. A. & Wichern, D. W. Applied Multivariate Statistical Analysis (Pearson Prentice Hall, 2007). 52. Nikaido, T., Sumitani, M., Sekiguchi, M. & Konno, S. e Spine painDETECT questionnaire: Development and validation of a screening tool for neuropathic pain caused by spinal disorders. PLoS One 13, e0193987 (2018). 53 Jolli e, I. T. Principal component analysis and factor analysis. In Principal Component Analysis (ed. Jolli e, I. T.) 150 166 (Springer, 2002). https:// doi. org/ 10. 1007/0- 387- 22440-8_7. 54. Wang, Q. & Guo, A. An e cient variance estimator of AUC and its applications to binary classi cation. Stat. Med. 39, 4281 4300 (2020).Author contributionsG.V.S. Conceptualization, Methodology, Formal analysis, Data visualization, Investigation, Writing original dra and Writing review & editing; G.M.P. Writing review & editing; B.G.P. Writing review & editing; S.P.L.L. Investigation and Writing review & editing; M.D.P.G. Investigation and Writing review & editing; 10 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 P.H.E.T. Conceptualization, Methodology, Investigation, Project administration, Supervision, Writing original dra and Writing review & editing. All authors reviewed the manuscript.Funding e funding was supported by Coordenação de Aperfeiçoamento de Pessoal de Nível Superior, 001, 002.Competing interests e authors declare no competing interests.Additional informationSupplementary Information e online version contains supplementary material available at https:// doi. org/ 10. 1038/ s41598- 023- 48551-1.Correspondence and requests for materials should be addressed to P.H.E.T.Reprints and permissions information is available at www.nature.com/reprints.Publisher s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional a liations. Open Access is article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. e images or other third party material in this article are included in the article s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.© e Author(s) 2023
Text excerpts (33 chunks)

chunk 0 · 443 tokens

1 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Simplified assessment of castration‑induced pain in pigs using lower complexity algorithmsGustavo Venâncio da Silva 1, Giovana Mancilla Pivato 1, Beatriz Granetti Peres 1, Stelio Pacca Loureiro Luna 2, Monique Danielle Pairis‑Garcia 3 & Pedro Henrique Esteves Trindade 1,3*Pigs are raised on a global scale for commercial or research purposes and often experience pain as a by product of management practices and procedures performed. Therefore, ensuring pain can be effectively identified and monitored in these settings is critical to ensure appropriate pig welfare. The Unesp‑Botucatu Pig Composite Acute Pain Scale (UPAPS) was validated to diagnose pain in pre‑weaned and weaned pigs using a combination of six behavioral items. To date, statistical weighting of supervised and unsupervised algorithms was not compared in ranking pain‑altered behaviors in swine has not been performed. Therefore, the aim of this study was to verify if supervised and unsupervised algorithms with different levels of complexity can improve UPAPS pain diagnosis in pigs undergoing castration. The predictive capacity of the algorithms was evaluated by the area under the curve (AUC). Lower complexity algorithms containing fewer pain‑altered behaviors had similar AUC (90.1–90.6) than algorithms containing five (89.18–91.24) and UPAPS (90.58). In conclusion, utilizing a short version of the UPAPS did not influence the predictive capacity of the scale, and therefore it may be easier to apply and be implemented consistently to monitor pain in commercial and experimental settings.Pigs (Sus scrofa domesticus) are raised worldwide for commercial or research purposes1,2. During their lifetime, pigs are

chunk 1 · 447 tokens

al and experimental settings.Pigs (Sus scrofa domesticus) are raised worldwide for commercial or research purposes1,2. During their lifetime, pigs are routinely submitted to painful procedures3,4, with castration commonly performed on most male pigs in commercial and research settings to improve meat quality and reduce the risk of injury associated with aggression5,6. Despite the immunocastration raising popularity in the global swine industry7, studies estimated that 61% of European male pigs8 and up to 94 million male piglets in the United States9 are surgically castrated annually. In a production context, painful conditions such as surgical castration can decrease performance and result in poor weight gain10, while in experimental frameworks, pain experienced by the animal can add bias to the scienti c research results11. Regardless of either scenario, the pig s welfare is compromised thus presenting an ethical and legal dilemma11 that needs to be addressed both on-farm and in the laboratory4,12.Pain is de ned as an unpleasant sensory and emotional experience associated with actual or potential tissue damage, or described in terms of such damage 13. For humans, the gold-standard method for pain assessment is through self-reporting14, however, in non-verbal animals, such as swine, methods to assess pain vary and include deviations to the animal s physiological (e.g. infrared thermography15, cortisol16 and prostaglandin-217) and behavioral response to post-painful procedure (e.g. pain scales18 21, time budget16,22 27, frequency of pain-associated behavioral expression16,24,27 29). Behavioral pain assessment is considered more favorable given it is non-intrusive, non-invasive, cost-e ective, and easier to assess across diverse farm or laboratory settings17.

chunk 2 · 327 tokens

s considered more favorable given it is non-intrusive, non-invasive, cost-e ective, and easier to assess across diverse farm or laboratory settings17. However, many veterinarians and farmers struggle with pain assessment in pigs30,31. In a previous study, 32.8% of farmers and 40.4% veterinarians agreed that it is di cult to recognise pain in pigs 3, and in other, only 32% of canadian veterinarians considered to have an adequate knowledge of analgesia in pigs31. To help mitigate this challenge, pain scales such as the Unesp-Botucatu Pig Composite Acute Pain Scale (UPAPS) have been developed based on pain-altered behaviors18 and validated as means to assess pain states a er surgical castration using OPEN 1Laboratory of Applied Artificial Intelligence in Health (LAAIH), Department of Anesthesiology, Botucatu Medical School, São Paulo State University (Unesp), Botucatu, São Paulo, Brazil. 2Department of Veterinary Surgery and Animal Reproduction, School of Veterinary Medicine and Animal Science, São Paulo State University (Unesp), Botucatu, São Paulo, Brazil. 3Global Production Animal Welfare Laboratory, Department of Population Health and Pathobiology, College of Veterinary Medicine, North Carolina State University (NCSU), Raleigh, NC, USA. *email: pesteve@ncsu.edu; pedro.trindade@unesp.br

chunk 3 · 449 tokens

2 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 recorded videos18,19. Currently, the UPAPS is composed of either ve (pre-weaned pigs) or six (weaned pigs) behavioral items categorized further into four scores18,19.Despite the advantages of the behavior-based pain scales in recognized animals pain, its use can be laborious particularly when the scale relies on several pain-altering behavioral items to be assessed simultaneously. Pain scales for humans and other species have bene ted from statistical weightings and improvements suggested by supervised and unsupervised algorithms32 35 to identify what behavioral items are more responsive (altered) than others. Supervised algorithms require a response variable to adjust the algorithm to account for conditions, such as painful or pain-free, while unsupervised algorithms do not use a response variable36. ese algorithms were used to rank behaviors of importance, which can result in not only improvements to the scale itself but may improve the veterinarians and farmers experience assessing pain when accomplished in a more e cient, less time-consuming and simple manner.Recently, our research team has demonstrated the weighted importance of pain-altered facial expression in horses using principal component analysis (unsupervised algorithm)35, in sheep using binomial multilevel logistic regression and random forest32 and in swine using binomial multilevel logistic regression (supervised algorithms)34. To date, no studies have been conducted in swine comparing supervised and unsupervised algo-rithms for weighting of pain-altered behaviors across ages (pre-weaned and weaned) and no work has compared the accuracy of multiple algorithms with di erent levels of complexity and variables. erefore,

chunk 4 · 450 tokens

ages (pre-weaned and weaned) and no work has compared the accuracy of multiple algorithms with di erent levels of complexity and variables. erefore, the aim of this study was to verify if supervised and unsupervised algorithms with di erent levels of complexity can improve UPAPS diagnosis in weaned and pre-weaned pigs undergoing castration. Our hypothesis was that lower com-plexity algorithms might improve UPAPS diagnosis.ResultsBinomial multiple logistic regression (LR)Logistic Regression algorithms indicated the signi cance of each pain-altered behavior contribution to the pain-free or painful condition. From 17 pain-altered behaviors of the UPAPS, the Full LR only had Wags Tail (wags tail continuously and intensely) with a signi cant contribution (p < 0.001) to the algorithm (Table 1), which was also the most important pain-altered behavior according to the Wald statistics of Full LR (Fig. 1a). A Re ned LR was then conducted to select the predictor variables for the best algorithm based on the best subsets technique using the Bayesian information criterion (BIC) as a ranking criterion. e BIC values were lower in Re ned LR (72.0) than in Full LR (142.5), demonstrating a better adjustment of the algorithm a er re nement. Six pain-altered behaviors were retained in the Re ned LR. Wags Tail (wags tail continuously and intensely), Posture 1 (changes posture with some discomfort), and Interaction 2 (occasionally moves away from the other animals, but accepts approaches and shows little interest in the surroundings) contributed signi cantly (p < 0.001) to the Re ned LR (Table 2), which were also the three most important pain-altered behaviors respectively (Fig. 1b). e three pain-altered behaviors related to activity were excluded in the Re ned LR. Table 1. Parameters of

chunk 5 · 260 tokens

n-altered behaviors respectively (Fig. 1b). e three pain-altered behaviors related to activity were excluded in the Re ned LR. Table 1. Parameters of the full binomial multiple logistic regression algorithm. Pain-free (before castration) or painful (a er castration) condition was used as a predictive variable and dummy of each pain-altered behavior of the Unesp-Botucatu Pig Composite Pain Scale as predictor variables. ParametersEstimateStandard errorp-valueLinear coe cient (α) − 3.9280.711 < 0.001Slope coe cients (β) Posture 13.1892.3690.178 Posture 222.9264712.5140.996 Posture 38.42311,217.2600.999 Interaction 11.4981.1780.203 Interaction 28.0045.6480.156 Interaction 312.91813,083.7500.999 Activity 11.2181.1440.286 Activity 2 − 2.6145.5410.637 Activity 3 − 0.6334.9390.897 Li pelvic limb − 0.9954.2820.816 Scratching rubbing − 4.5714.9530.356 Walk away run15.1474682.1430.997 Sit with di culty0.1672.2160.939 Wags tail5.7681.272 < 0.001 Bite grill1.7171.01870.092 Head down21.6834119.6890.996 Di culty overcoming0.1185.0040.981

chunk 6 · 253 tokens

3 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Figure 1. Importance of the pain-altered behaviors of the Unesp-Botucatu Pig Composite Pain Scale based on (a) Full logistic regression, (b) Re ned logistic regression, (c) Full discriminant canonical analysis and (d) Re ned discriminant canonical analysis, (e) Full principal component analysis, and (f) Re ned principal component analysis. Table 2. Parameters of the re ned binomial multiple logistic regression algorithm. Pain-free (before castration) or painful (a er castration) condition was used as a predictive variable and dummy of each pain-altered behavior of the Unesp-Botucatu Pig Composite Pain Scale as predictor variables. ParametersEstimateStandard errorp-valuesLinear coe cient (α) − 3.0930.457 < 0.001Slope coe cients (β) Posture 15.0451.161 < 0.001 Posture 220.2213067.4210.995 Interaction 24.1941.241 < 0.001 Interaction 320.9974684.4590.996 Wags tail5.1801.153 < 0.001 Head down20.6882684.2480.993

chunk 7 · 449 tokens

4 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Discriminant canonical analysis (CDA)Full CDA was performed using the ve UPAPS items (Posture, Interaction, Activity, Attention and Miscellane-ous) as grouping variables as pain-free or painful condition as a response variable. Re ned CDA was performed using four UPAPS items, excluding the item Activity and using Condition as response variable. As Condition is a binomial variable, the algorithms generated only one canonical discriminant function, which accounted for 100% of variation in both cases. Miscellaneous item had the greater linear discriminant for both Full and Re ned CDA (0.80 in both algorithms), while in Full CDA the smaller linear discriminant was from Activity item (0.18) and in Re ned CDA it was from Attention item (0.22) (Fig. 1c and d).Principal component analysis (PCA)Full PCA was performed using the ve UPAPS items and ve principal components (PC) were generated. Horn s parallel analysis indicated only the retention of the rst principal component (PC1). e PC1 accounted for 72.45% of variance and eigenvalue of 3.62. For variance and eigenvalue of all principal components please see Table S1. e Interaction item had the higher loading value (0.47), while the Activity item had the lower (0.42) (Fig. 1e). Re ned PCA was performed using four UPAPS items, excluding the Activity item, generating four PCs. Horn s parallel analysis also indicated only the retention of the PC1. In this algorithm, PC1 accounted for 76.16% of variance and eigenvalue of 3.04. For variance and eigenvalue of all principal components please see Table S2. e Posture item had the higher loading value (0.52), while the Miscellaneous item had the lower (0.48) (Fig. 1f).Predictive capacityAll areas

chunk 8 · 449 tokens

able S2. e Posture item had the higher loading value (0.52), while the Miscellaneous item had the lower (0.48) (Fig. 1f).Predictive capacityAll areas under the curve (AUCs) from receiver operating characteristic (ROC) curves generated from the algo-rithms output were above 90%, except for Re ned LR that was 89.18% (Table 3). No algorithm was statistically di erent from UPAPS by DeLong test (p > 0.05). Sensitivity estimates (median) ranged from 0.88 to 0.90, while speci city estimates (median) ranged from 0.86 to 0.90.DiscussionCastration-induced pain is a critical welfare issue that can be a legal and ethical obligation for swine used for research and husbandry purposes and evaluating deviations to the pig s behavioral response is an e ective means to diagnosing pain accurately17. Unesp-Botucatu Pig Composite Acute Pain Scale (UPAPS) is a species-speci c tool developed for assessing swine pain and has been validated for use in weaned18 and pre-weaned pigs19 under-going castration. Because simultaneous assessment of multiple pain-altering behaviors may be di cult, we used statistical weightings to graduate the importance of behavioral items to facilitate using the scale. erefore, we investigated if supervised and unsupervised algorithms with di erent levels of complexity improved UPAPS diagnosis across weaned and pre-weaned pigs. is study utilized LR, CDA and PCA algorithms to assess the importance of pain-altered behaviors used in the UPAPS. e results from this study demonstrated that lowering algorithm complexity by removing the Activ-ity item preserved the predictive capacity when applying the weightings using CDA and PCA. ese techniques generated parameters that were applied to ranking pain-altered behaviors and all Re ned algorithms had statisti-cally similar

chunk 9 · 447 tokens

and PCA. ese techniques generated parameters that were applied to ranking pain-altered behaviors and all Re ned algorithms had statisti-cally similar AUC to Full algorithms with an AUC above 89%. Activity item comprises behavioral responses that are increased in painful conditions in some studies17,28 and decreased in another37. Additionally, younger pigs are less a ected behaviorally by castration-induced pain than older ones38. Activity behaviors as described in UPAPS are known to rely on housing conditions, which depends on both the animal facility structure and/or guidelines and on animals age39. ese three factors might explain why Activity pain-altered behaviors were consistently less important in some algorithms when two datasets including weaned and pre-weaned pigs were merged. Another explanation for the apparent less importance of the Activity item is overlapping with pain-altered behaviors in Posture and Interaction items, which might be caused by description similarities18,23. e Activity item was considered with satisfactory consistency, inter- and intra-observer reliability in previous studies18,19. In a recent study, Activity pain-altered behaviors had high statistical importance34. We reasoned that this might be caused by Table 3. Area under the curve (AUC) from receiver operating characteristic (ROC) curves of each algorithm and the Unesp-Botucatu Pig Composite Pain scale. Data are presented as median (95% con dence interval). AUC was compared based on DeLong test. LR binomial multiple logistic regression, PCA principal component analysis, CDA canonical discriminant analysis, NA not applied. P-value refers to DeLong test, applied to compare AUC between the speci ed ROC curve and Unesp-Botucatu Pig Composite Pain Scale ROC curve. ROC curveAUC

chunk 10 · 213 tokens

value refers to DeLong test, applied to compare AUC between the speci ed ROC curve and Unesp-Botucatu Pig Composite Pain Scale ROC curve. ROC curveAUC (%)p-value (UPAPS vs) resholdSensitivitySpeci cityUPAPS90.58 (84.32 96.84)NA2.50 (1.50 3.50)0.90 (0.8 0.98)0.88 (0.78 0.98)UPAPS without activity91.24 (85.33 97.15)0.3172.00 (1.50 2.50)0.90 (0.78 0.96)0.88 (0.78 0.96)Full LR90.6 (84.57 96.63)0.9800.86 (0.15 0.88)0.88 (0.78 0.98)0.90 (0.76 0.98)Re ned LR89.18 (82.72 95.64)0.3580.40 (0.40 0.99)0.90 (0.76 0.98)0.86 (0.74 0.94)Full PCA91.32 (85.29 97.35)0.2710.92 (0.45 1.32)0.90 (0.80 0.98)0.90 (0.80 0.98)Re ned PCA91.52 (85.60 97.44)0.1291.01 (0.50 1.48)0.90 (0.80 0.98)0.90 (0.80 0.98)Full CDA90.56 (84.45 96.67)0.9820.86 (0.86 1.42)0.90 (0.78 0.98)0.88 (0.76 0.96)Re ned CDA90.12 (83.80 96.44)0.6030.93 (0.93 1.45)0.90 (0.78 0.98)0.88 (0.76 0.96)

chunk 11 · 448 tokens

5 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 methodological di erences. In previous studies of weighting UPAPS castration-induced pain-altered behaviors, the response variable was the observer analgesia indication34, while in ours it is the condition (painful or pain-free). Altogether, such pieces of evidence suggest the removal of the Activity item from UPAPS when applying the weightings by CDA or PCA across ages for diagnosing castration-induced pain. is speci c nding also gave us the insight that the importance of each pain-altered behavior might not be closely related to consistency or observer reliability, and the relationship between them could be investigated in the future.Posture and Interaction items were consistently important for all algorithms. In Re ned LR, two out of three pain-altered behaviors with a signi cant slope coe cient were from Posture and Interaction items. Both CDA discriminant coe cients and PCA loading values also indicated Posture and Interaction items as one of the most important items of the UPAPS. Posture and Interaction items comprise castration-induced pain-altered behaviors that are similar to behaviors found to be altered in other studies23,25,28,37,38 thus supporting their importance. In a previous study, where UPAPS was weighted following a binomial multilevel logistic regression using a weaned pigs dataset, Posture and Interaction behaviors were also of high importance34.In LR and CDA algorithms, Miscellaneous item (CDA) or its individual pain-altered behaviors (LR) were indicated as one of the most important, while in PCA, this item was one of the least important. is di erence can be partially explained due to LR and CDA being supervised techniques, in other words, it uses a response

chunk 12 · 449 tokens

one of the least important. is di erence can be partially explained due to LR and CDA being supervised techniques, in other words, it uses a response variable, while PCA is an unsupervised technique, it does not need a response variable36. Since PCA loading values may be interpreted as the amount of variance that a variable had40, we might argue that Miscellaneous pain-altered behaviors varied less than the other ones, but when it occurred, it contributed signi cantly to the response variable outcome. Miscellaneous pain-altered behaviors are likely correlated with the response variable shi (painful and pain-free condition) and this can be partially explained because it is composed of behaviors related to castration-induced pain or discomfort, while part of the other UPAPS items are related to maintenance behaviors that can or cannot be altered when the pig is experiencing pain. ese results reinforce the need for the comparison between techniques, as demonstrated on sheep32. In addition, because the majority of validation steps are unsupervised techniques, future re nement and validation processes may bene t from the use of LR and CDA, as suggested previously41.Changes in UPAPS were expected since this is the rst time a supervised algorithm was applied to weight the castration-induced pain-altered behaviors of the scale using a dataset of weaned and pre-weaned piglets. In Full LR algorithm, only the slope coe cient from the Wags Tail behavior was statistically signi cant, while there were other slope coe cients that had negative estimates. ese results combined suggest a poor adjustment of the algorithm, which supported a re nement in which pain-altered behaviors should be considered. Re ned LR had the lowest BIC combination of pain-altered behaviors and it was the

chunk 13 · 448 tokens

ed a re nement in which pain-altered behaviors should be considered. Re ned LR had the lowest BIC combination of pain-altered behaviors and it was the best-adjusted algorithm. Also in Re ned LR, we found three pain-altered behaviors with low Wald statistics and high standard error: Posture 2 (Changes posture, with discomfort, and protects the a ected area), Head Down and Interaction 3 (Moves or runs away from other animals and does not allow approaches; disinterested in the surroundings). Considering that Re ned LR was the best-adjusted algorithm, these three items might occur in agreement with the response variable. is study is not free of limitations. First, all studies in pain-altered behavior must face the fact that in some species, the pain perception threshold is altered by negative a ective states, such as anxiety and distress4. In agreement with that, there are no behaviors that exclusively address pain, but the assessment of pain-altered behaviors substantially contributes to identifying pain42. In our study, some dissimilarities in housing might a ect the behavior response43. Also, UPAPS Appetite item was not considered because it had no statistical signi cance in our previous study34, however, altered feeding behavior was reported in another research as a pain indicator for pre-weaned piglets44. Another limitation of this study was the unbalanced number of pigs in each dataset. Although there was not a sign of under tting according to AUC, sensitivity and speci city of the algorithms, further studies could increase the sample size. In addition, the di erence in the pain control protocol between the databases due to the legislation for each host country represents a study limitation. Lastly, timing of obser-vations was slightly di erent between the two

chunk 14 · 450 tokens

ases due to the legislation for each host country represents a study limitation. Lastly, timing of obser-vations was slightly di erent between the two datasets merged in the current study, however, they represent the same conditions.Realistically, this study might improve the practice of veterinarians who consider their knowledge not suf- cient for assessing pain in pigs31 or for farmers and veterinarians who nd this evaluation di cult30, although this was not tested yet. e AUC from UPAPS original weighting without the Activity item was statistically similar to the full UPAPS, which supports a shorter version of the scale. A shorter version of UPAPS may be easier to apply with fewer items, increasing the chance for its employment and regular use in commercial and experimental contexts. Our study considered surgical castration-induced pain to re ne the UPAPS, however, some UPAPS pain-altered behaviors are related to the surgical areas, and the scale also might be helpful for pain diagnosing due to surgeries performed in the same area of the pig body. Also, UPAPS maintenance behaviors might be a general contribution for pain recognition from other sources. ese two points may be relevant since the UPAPS pain-altered behaviors are easily recognizable by evaluators in the tutorial videos on the Animal Pain webpage (https:// anima lpain. org/ en/ home- en/). Both extrapolations of our ndings require to be tested by clini-cal studies assessing multiple painful conditions, however, it is very likely that in other contexts, with di erent types, areas, durations and or intensities of pain, the UPAPS would need further adaptations that could employ the same rationale used in the present study.Behavioral methods for assessing pain such as UPAPS are essential in recognizing and

chunk 15 · 173 tokens

ns that could employ the same rationale used in the present study.Behavioral methods for assessing pain such as UPAPS are essential in recognizing and quantifying pain in animals45 and therefore their shortening and usability re nement contributes not only to improving pig pain diagnosis but also to welfare. e average time to score original and shortened UPAPS as well as the potential gain of accuracy of the shortened UPAPS should be assessed in future studies. Yet, the shortened scale might be used for developing so ware that automates pain diagnosis. e present study also reinforces the importance of employing supervised and unsupervised algorithms to rank pain-altered behaviors.

chunk 16 · 449 tokens

6 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 We concluded that lowering the complexity of supervised and unsupervised algorithms for the statistical weighting of UPAPS is bene cial and helped to identify important behaviors and suggest a potential more e cient acute pain scale to be used in piglets undergoing surgical castration with no impairment in predictive capacity. Further studies might con rm or not our ndings by monitoring piglets pain in a real-world setting.MethodsIn the current study data was obtained from two previous publications18,19. e rst study was approved by the Ethical Committee for the Use of Animals in Research of the School of Veterinary Medicine and Animal Sci-ence, Unesp, Botucatu, Brazil, under protocol number 102/2014 and followed the Brazilian Federal legislation of National Council for the Control of Animal Experimentation (CONCEA)18. e second study was approved by the North Carolina State University Animal Care and Use Committee under protocol number 19-79619. Both previous publications and the current study followed ARRIVE guidelines for animal research reports46. Together, both datasets were used as our database as we understand that data reuse contributes to two of the four R s of animal research (reduce and responsibility)47,48.DatasetsWeaned pigs dataset18 comprised behavioral observations of pigs in pre- and post-castration timepoints. ere were 45 Landrace, Large White, Duroc and Hampshire male pigs randomly selected from the university com-mercial production. e animals were aged 38 + 3 days and weighed 11.06 + 2.28 kg, and were housed in iron pens (2.40 × 1.50 × 1.50 m of length x width x height) located side by side separated by bars in groups of ve pigs. Before the surgery, pigs were

chunk 17 · 446 tokens

ron pens (2.40 × 1.50 × 1.50 m of length x width x height) located side by side separated by bars in groups of ve pigs. Before the surgery, pigs were submitted to bilateral local anesthesia with 0.5 mL of 1% lidocaine without vasoconstrictor (Xylestesin®, Cristália, Itapira, São Paulo, Brazil) injected subcutaneously at each incision line, parallel to the scrotum sha , followed by 1 mL injected intratesticularly at each testicle, and the surgery was per-formed a er ve minutes. Surgical castration was always performed by the same trained surgeon. Details about surgical procedures and housing conditions were described in the previous study18. e pigs were recorded from 24 to 16 h before surgery (pain-free condition), 3.5 to 4 h a er surgery (pain condition), and other timepoints from which observations were not used in this study. In each timepoint, animals were evaluated for at least four minutes. All video recordings were assessed by three observers according to UPAPS. ey were referred to as Gold Standard, Observer 1 and Observer 2 in the original paper15. In the original study, all observers assessed all videos (phase 1) and repeated all video assessments a er an interval (phase 2) due to psychometric validation steps, however, we used only the rst phase of the assessment to merge two datasets, since in the second dataset (described below) was performed only one assessment phase.Pre-weaned pigs dataset19 comprised behavioral observations of piglets in pre- and post-castration timepoints. ere were 39 Yorkshire-Landrace x Duroc piglets enrolled in the study. e animals were aged ve days and weighed 1.62 ± 0.23 kg, housed with sows in individual farrowing crates (0.8 × 2.3 m of length x width) in fully slatted oors in a farrowing room with controlled

chunk 18 · 448 tokens

± 0.23 kg, housed with sows in individual farrowing crates (0.8 × 2.3 m of length x width) in fully slatted oors in a farrowing room with controlled environment conditions. General or local anesthesia was not administered, as it is standard practice in the United States and the procedure followed the standard operating procedure approved by the attending veterinarian. All male piglets at this facility underwent castration prior to weaning, therefore the castration procedure would have occurred regardless of the research. Surgical castration was always performed by the same trained surgeon. Details about surgical procedures and housing conditions were described in the previous study19. However, all piglets enrolled in Pre-weaned pigs dataset did receive intramuscular unixin meglumine (2.2 mg/kg unixin meglumine IM; Merck Animal Health, Millsboro, DE, US) one hour a er surgery. e animals were recorded at 24 h before surgery (pain-free condition), 15 min a er surgery (pain condition), and other timepoints from which observations were not used in this study. e animals were recorded and video clips of 4 min were obtained. Some piglets were asleep, so we only considered assess-ments of awake piglets (n = 14). All video recordings were assessed by two observers in a single assessment phase.First, both datasets were split separately into (i) a train set comprising 70% of pigs (31 weaned and 10 pre-weaned) selected randomly, used for algorithm tting, and (ii) a test set with 30% of reminiscent pigs (14 weaned and 4 pre-weaned), used for algorithm predicting. Following, train and test sets from weaned and pre-weaned pigs datasets were merged. en, both train and test sets contained ve observers, two perioperative timepoints, and two age groups, changing the number of

chunk 19 · 361 tokens

datasets were merged. en, both train and test sets contained ve observers, two perioperative timepoints, and two age groups, changing the number of pigs and consequently the number of observations (410 and 180, respectively 70 and 30%).Pain‑altered behavior scaleIn the UPAPS, six behavioral items regarding posture, interaction and interest in the surroundings, activity, appe-tite (for weaned pigs), attention to the a ected area and miscellaneous behaviors are assessed. ese behavioral items are descriptive and composed by four score levels: 0 , 1 , 2 and 3 , according to the presence or absence of pain-related behaviors (Table 4). In the UPAPS validation for pre-weaned pigs, the nursing behavior would be analogous to the appetite in weaned pigs, but Nursing item was disregarded for pre-weaned piglets19. In order to merge the databases, the appetite and nursing items were disregarded. en, the total sum of the ve behavioral items scores (0 15) were considered to assess pain.Statistical descriptionAll statistical procedures were performed in R language, using RStudio integrated development environment49 (Version 4.2.2; RStudio, Inc., Boston, MA, USA). e functions and packages were presented in the format package::function . p-values were considered signi cant when p ≤ 0.05 in all tests. Figures were colored using a color palette distinguishable for common kinds of colorblindness (ggplot2::scale_colour_viridis_d).

chunk 20 · 448 tokens

7 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Multilevel binomial logistic regression (LR)Logistic Regression is a classi cation technique widely used for di erent purposes50. In this study, we used it to compute the respective probability of each observation (pain assessment) on being classi ed as pain or pain-free condition. A full algorithm (Full LR), containing all predictor variables was created, and used as reference for an automated algorithm selection (glmulti::glmulti) referred to as best subsets technique. is technique nds the best candidate algorithms with optimized information criteria. To select the best subset of predictors, we considered the Bayesian information criterion (BIC), which penalizes the predictor inclusion, and therefore it contributes to nding the better tting with less predictor s algorithms. An exhaustive search was used to nd the exact solution. e best BIC algorithm is referred to as Re ned LR.Both Full LR and Re ned LR followed the same procedures. Algorithms were created in the train set using stats::glm, using condition as response variable (0 = absence of pain, corresponding to M1; and 1 = presence of pain, corresponding to M2). e behavioral items from UPAPS were converted into dummy variables (0 = absence and 1 = presence of each behavior) (fastDummies::dummy_columns), and then used as predictor variables. A er algorithm tting, the event probability of occurring (Condition classi cation as 1) was computed for each observation in the test set (stats::predict). Wald statistics generated from the algorithms were used to rank behaviors, as proposed previously34.Canonical discriminant analysis (CDA)Canonical Discriminant Analysis is a variation of the linear discriminant analysis with the

chunk 21 · 449 tokens

proposed previously34.Canonical discriminant analysis (CDA)Canonical Discriminant Analysis is a variation of the linear discriminant analysis with the related Fisher s linear discriminant method. It nds a linear combination of features that may be used as a classi er or dimensionality reduction before classi cation51. In this study, we adapted CDA to use a binomial response variable, rather than a multiclass variable, and performed it to compare its classi cation along with binomial multiple logistic regres-sion (LR) and principal component analysis (PCA, described next). A Full CDA, with all ve items as variables, and a Re ned CDA, without Activity item, were performed. Activity was withdrawn because the best subsets technique for LR indicated the removal of all pain-altered behaviors related with Activity, so it was needed for a fair comparison. Both Full and Re ned CDA followed the same procedures. Table 4. Unesp-Botucatu Pig Composite Pain Scale system without appetite or nursing item18,19. ItemScoreScore/criterionLinks to videosPosture0Normal (any position, apparent comfort, relaxed muscles) or sleepinghttps:// youtu. be/ QSosC D2SD4E1Changes posture, with discomforthttps:// youtu. be/ SpaWs FCrPxE2Changes posture, with discomfort, and protects the a ected areahttps:// youtu. be/ VjSls RrG8yA3Quiet, tense, and back archedhttps:// youtu. be/ pm4hJ 5163aoInteraction and interest in the surroundings0Interacts with other animals; interested in the surroundings or sleepinghttps:// youtu. be/- 880ST gYq2I1Only interacts if stimulated by other animals; interested in the surroundingshttps:// youtu. be/ nXjOd wn3dyw2Occasionally moves away from the other animals, but accepts approaches; shows little interest in the surroundingshttps:// youtu. be/ 2k2JD r5U6As3Moves or

chunk 22 · 383 tokens

sionally moves away from the other animals, but accepts approaches; shows little interest in the surroundingshttps:// youtu. be/ 2k2JD r5U6As3Moves or runs away from other animals and does not allow approaches; disinterested in the surroundingshttps:// youtu. be/ se70o YXcWFwActivity0Moves normally or sleepinghttps:// youtu. be/ cC75t 7L5- YA1Moves with less frequencyhttps:// youtu. be/ lQo9w q8LAn82Moves constantly, restlesshttps:// youtu. be/ YQRJj ijLvpk3Reluctant to move or does not movehttps:// youtu. be/ Zyx0G 3Wpt8oAttention to the a ected areaA. Elevates pelvic limb or alternates the support of the pelvic limbhttps:// youtu. be/ UD99 O7HE0B. Scratches or rubs the painful areahttps:// youtu. be/ 7idfF k1harEC. Moves and/or runs away and/or jumps a er injury of the a ected areahttps:// youtu. be/u- Pqubo m278D. Sits with di cultyhttps:// youtu. be/ ETNEO CVV4h00All the above behaviors are absent1Presence of one of the above behaviors2Presence of two of the above behaviors3Presence of three or all the above behaviorsMiscellaneous behaviorsA. Wags tail continuously and intenselyhttps:// youtu. be/ pU5dG ZFNRHcB. Bites the bars or objectshttps:// youtu. be/ cF3ds q7gMtkC. e head is below the line of the spinal columnhttps:// youtu. be/ ZcIgn gclRpID. Presents di culty in overcoming obstacles (example: another animal)https:// youtu. be/ HlvdO I3lGuY0All the above behaviors are absent1Presence of one of the above behaviors2Presence of two of the above behaviors3Presence of three or all the above behaviors

chunk 23 · 449 tokens

8 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 Canonical discriminant analysis was performed using Condition as grouping factor and UPAPS behavioral items scores as discriminators, using MASS::lda in the train set. Coe cients of linear discriminants were used to predict the probability of presence of pain (Condition = 1) in each observation of the test set. e discriminant coe cients were used as CDA weightings to obtain a new total score. For this purpose, each UPAPS item was multiplied by its respective CDA weighting (discriminant coe cient), resulting in a new score for each item. e new scores were added, resulting in a new total score for Full CDA and for Re ned CDA. Discriminant coe cients generated from the algorithms were also used to rank behavioral items, as proposed previously52.Principal component analysis (PCA)Principal component analysis was used as an unsupervised comparison to supervised technique (logistic regres-sion and canonical discriminant analysis). Principal Component Analysis is a dimensionality reduction technique that retains data variation that also might be used for testing the multiple association between variables53. It is performed by reducing the number of variables into principal components (PCs), where the data variation is maximal40. Similarly to CDA, a Full PCA and a Re ned PCA without Activity, for the same reason, were per-formed and followed the same procedures described in this section. e number of PCs retained was de ned by Horn s parallel analysis using psych::fa.parallel on the train set. is method compares the factors scree of the observed data to a randomly generated one, of a data matrix of the same size as ours. e correlation matrix used Pearson correlation. e method was computed

chunk 24 · 446 tokens

ed data to a randomly generated one, of a data matrix of the same size as ours. e correlation matrix used Pearson correlation. e method was computed a er 1,001 simulated analyses performed.PCA was then performed (stats::princomp) on the train set. Eigean values were calculated using the standard deviation of the principal components. Loading values were obtained using stats::loadings. e loading values were used to mutate the original scores in the test set, resulting in a new total score based on PCA weightings. e loading values were used as PCA weightings to obtain a new total score. For this purpose, each UPAPS item was multiplied by its respective PCA weighting (loading value), resulting in a new score for each item. e new scores were added, resulting in a new total score for Full PCA and for Re ned PCA.Loading values generated from the algorithms were also used to rank behavioral items, as proposed previously35.Predictive capacity e area under the curve (AUC) from receiver operating characteristic (ROC) curve is a widely used technique to evaluate the performance of a binary classi er system as its discrimination threshold varies54. A ROC curve was generated using the Condition classes (pain and free-pain) as a predictor variable and each one of the six algorithms predicted in the test set, using pROC::ROC. It was also generated a ROC curve using UPAPS original scores and UPAPS scores without the Activity item. is function returns the AUC and its respective con -dence interval. Furthermore, threshold, sensitivity, sensibility, and their respective 95% of con dence intervals were obtained for each ROC curve using pROC::ci.coords. reshold was calculated using the Youden method. Both ROC and its coordinates were generated using 95% of con dence and

chunk 25 · 449 tokens

C curve using pROC::ci.coords. reshold was calculated using the Youden method. Both ROC and its coordinates were generated using 95% of con dence and bootstrapping strati cation of 1001 replicates.DeLong test was used to compare the AUCs generated from UPAPS and each algorithm. If more than one algorithm was detected as di erent from UPAPS, they were tested between them. DeLong test was performed using pROC::roc.test.Data availabilityWeaned pigs dataset18 and Pre-weaned pigs dataset19 were already publicly available in the supplementary mate-rial of their respective publications. Also, merged datasets analyzed during this study and the R script were included in its supplementary information les.Received: 25 August 2023; Accepted: 28 November 2023 References 1. Food and Agriculture Organization of the United Nations. Meat Market Review - Emerging trends and outlook (2022). 2. Bergen, W. G. Pigs (Sus Scrofa) in biomedical research. Adv. Exp. Med. Biol. 1354, 335 343 (2022). 3. Ison, S. H., Clutton, R. E., Di Giminiani, P. & Rutherford, K. M. D. A review of pain assessment in pigs. Front. Vet. Sci. https:// doi. org/ 10. 3389/ fvets. 2016. 00108 (2016). 4. Steagall, P. V., Bustamante, H., Johnson, C. B. & Turner, P. V. Pain management in farm animals: Focus on cattle sheep and pigs. Animals (Basel) 11, 1483 (2021). 5. von Borell, E. et al. Animal welfare implications of surgical castration and its alternatives in pigs. Animal 3, 1488 1496 (2009). 6. Bonneau, W. Pros and cons of alternatives to piglet castration: Welfare, boar taint, and other meat quality traits. Animals 9, 884 (2019). 7. Čandek-Potokar, M., krlep, M. & Zamaratskaia, G. Immunocastration as Alternative to Surgical Castration in Pigs (InTech, 2017). https:// doi. org/ 10. 5772/ intec hopen. 68650. 8.

chunk 26 · 234 tokens

& Zamaratskaia, G. Immunocastration as Alternative to Surgical Castration in Pigs (InTech, 2017). https:// doi. org/ 10. 5772/ intec hopen. 68650. 8. De Briyne, N., Berg, C., Blaha, T. & Temple, D. Pig castration: Will the EU manage to ban pig castration by 2018?. Porcine Health Manag. 2, 29 (2016). 9. Wagner, B., Royal, K., Park, R. & Pairis-Garcia, M. Identifying barriers to implementing pain management for piglet castration: A focus group of swine veterinarians. Animals (Basel) 10, 1202 (2020). 10. Telles, F. G., Luna, S. P. L., Teixeira, G. & Berto, D. A. Long-term weight gain and economic impact in pigs castrated under local anaesthesia. Vet. Anim. Sci. 1 2, 36 39 (2016). 11. Carbone, L. Pain in laboratory animals: e ethical and regulatory imperatives. PLoS One 6, e21578 (2011). 12. Grethe, H. e economics of farm animal welfare. SSRN Sch. Pap. https:// doi. org/ 10. 1146/ annur ev- resou rce- 100516- 053419 (2017).

chunk 27 · 448 tokens

9 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 13. Raja, S. N. et al. e revised International Association for the Study of Pain de nition of pain: Concepts, challenges, and compro-mises. Pain 161, 1976 1982 (2020). 14. Schiavenato, M. & Craig, K. Pain assessment as a social transaction beyond the gold standard . Clin. J. Pain 26, 667 676 (2010). 15. Whittaker, A. L. et al. Assessment of pain and in ammation in domestic animals using infrared thermography: A narrative review. Animals 13, 2065 (2023). 16. Sutherland, M. A., Backus, B. L., Brooks, T. A. & McGlone, J. J. e e ect of needle-free administration of local anesthetic on the behavior and physiology of castrated pigs. J. Vet. Behav. 21, 71 76 (2017). 17. Baysinger, A. et al. Proposed multidimensional pain outcome methodology to demonstrate analgesic drug e cacy and facilitate future drug approval for piglet castration. Anim. Health Res. Rev. 22, 163 176 (2021). 18. Luna, S. P. L. et al. Validation of the UNESP-Botucatu pig composite acute pain scale (UPAPS). PLoS One 15, e0233552 (2020). 19. Robles, I. et al. Validation of the Unesp-Botucatu pig composite acute pain scale (UPAPS) in piglets undergoing castration. PLoS One 18, e0284218 (2023). 20. Viscardi, A. V., Hunniford, M., Lawlis, P., Leach, M. & Turner, P. V. Development of a piglet grimace scale to evaluate piglet pain using facial expressions following castration and tail docking: A pilot study. Front. Vet. Sci. 4, 51 (2017). 21. Navarro, E., Mainau, E. & Manteca, X. Development of a facial expression scale using farrowing as a model of pain in sows. Animals 10, 2113 (2020). 22. Carroll, J. A., Berg, E. L., Strauch, T. A., Roberts, M. P. & Kattesh, H. G. Hormonal pro les, behavioral responses, and short-term

chunk 28 · 447 tokens

, 2113 (2020). 22. Carroll, J. A., Berg, E. L., Strauch, T. A., Roberts, M. P. & Kattesh, H. G. Hormonal pro les, behavioral responses, and short-term growth performance a er castration of pigs at three, six, nine, or twelve days of age1,2. J. Anim. Sci. 84, 1271 1278 (2006). 23. Hay, M., Vulin, A., Génin, S., Sales, P. & Prunier, A. Assessment of pain induced by castration in piglets: Behavioral and physi-ological responses over the subsequent 5 days. Appl. Anim. Behav. Sci. 82, 201 218 (2003). 24. Leidig, M. S., Hertrampf, B., Failing, K., Schumann, A. & Reiner, G. Pain and discomfort in male piglets during surgical castration with and without local anaesthesia as determined by vocalisation and defence behaviour. Appl. Anim. Behav. Sci. 2 4, 174 178 (2009). 25. McGlone, J. J., Nicholson, R. I., Hellman, J. M. & Herzog, D. N. e development of pain in young pigs associated with castration and attempts to prevent castration-induced behavioral changes. J. Anim. Sci. 71, 1441 1446 (1993). 26 Morrison, R. & Hemsworth, P. Tail docking of piglets 2: E ects of meloxicam on the stress response to tail docking. Animals (Basel) 10, 1699 (2020). 27. Sutherland, M. A., Davis, B. L., Brooks, T. A. & Coetzee, J. F. e physiological and behavioral response of pigs castrated with and without anesthesia or analgesia1. J. Anim. Sci. 90, 2211 2221 (2012). 28. Sutherland, M. A., Davis, B. L., Brooks, T. A. & McGlone, J. J. Physiology and behavior of pigs before and a er castration: E ects of two topical anesthetics. Animal 4, 2071 2079 (2010). 29. Torrey, S., Devillers, N., Lessard, M., Farmer, C. & Widowski, T. E ect of age on the behavioral and physiological responses of piglets to tail docking and ear notching. J. Anim. Sci. 87, 1778 1786 (2009). 30. Ison, S. H. & Rutherford,

chunk 29 · 447 tokens

behavioral and physiological responses of piglets to tail docking and ear notching. J. Anim. Sci. 87, 1778 1786 (2009). 30. Ison, S. H. & Rutherford, K. M. D. Attitudes of farmers and veterinarians towards pain and the use of pain relief in pigs. Vet. J. 202, 622 627 (2014). 31. Hewson, C. J., Dohoo, I. R., Lemke, K. A. & Barkema, H. W. Canadian veterinarians use of analgesics in cattle, pigs, and horses in 2004 and 2005. Can. Vet. J. 48, 155 164 (2007). 32. Trindade, P. H. E., de Mello, J. F. S. R., Silva, N. E. O. F. & Luna, S. P. L. Improving ovine behavioral pain diagnosis by implementing statistical weightings based on logistic regression and random forest algorithms. Animals (Basel) 12, 2940 (2022). 33. Turner, D. et al. Mathematical weighting of the pediatric Crohn s disease activity index (PCDAI) and comparison with its other short versions. In amm. Bowel Dis. 18, 55 62 (2012). 34 Trindade, P. H. E., de Araújo, A. L. & Luna, S. P. L. Weighted pain-related behaviors in pigs undergoing castration based on mul-tilevel logistic regression algorithm. Appl. Anim. Behav. Sci. https:// doi. org/ 10. 1016/j. appla nim. 2023. 106002 (2023). 35. Carvalho, J. R. G. et al. Facial expressions of horses using weighted multivariate statistics for assessment of subtle local pain induced by polylactide-based polymers implanted subcutaneously. Animals (Basel) 12, 2400 (2022). 36 Alloghani, M., Al-Jumeily, D., Musta na, J., Hussain, A. & Aljaaf, A. J. A systematic review on supervised and unsupervised machine learning algorithms for data. Science https:// doi. org/ 10. 1007/ 978-3- 030- 22475-2_1 (2020). 37. Taylor, A. A., Weary, D. M., Lessard, M. & Braithwaite, L. Behavioural responses of piglets to castration: e e ect of piglet age. Appl. Anim. Behav. Sci. 73, 35 43

chunk 30 · 447 tokens

Weary, D. M., Lessard, M. & Braithwaite, L. Behavioural responses of piglets to castration: e e ect of piglet age. Appl. Anim. Behav. Sci. 73, 35 43 (2001). 38. McGlone, J. J. & Hellman, J. M. Local and general anesthetic e ects on behavior and performance of two- and seven-week-old castrated and uncastrated piglets. J. Anim. Sci. 66, 3049 3058 (1988). 39. Ludwiczak, A. et al. How housing conditions determine the welfare of pigs. Animals 11, 3484 (2021). 40. Ringnér, M. What is principal component analysis?. Nat. Biotechnol. 26, 303 304 (2008). 41 Streiner, D. L., Norman, G. R. & Cairney, J. Health Measurement Scales: A Practical Guide to eir Development and Use (Oxford University Press, 2015). 42. Prunier, A. et al. Identifying and monitoring pain in farm animals: A review. Animal 7, 998 1010 (2013). 43. Steybe, L., Kress, K., Schmucker, S. & Stefanski, V. Impact of housing condition on welfare and behavior of immunocastrated fat-tening pigs (Sus scrofa domestica). Animals 11, 618 (2021). 44 McGlone, J., Guay, K. & Garcia, A. Comparison of intramuscular or subcutaneous injections vs. castration in pigs impacts on behavior and welfare. Animals 6, 52 (2016). 45. Gigliuto, C. et al. Pain assessment in animal models: Do we need further studies?. J. Pain Res. 7, 227 236 (2014). 46 Percie Du Sert, N. et al. Reporting animal research: Explanation and elaboration for the ARRIVE guidelines 2.0. PLoS Biol. 18, e3000411 (2020). 47. Russell, W. M. S. & Burch, R. L. e Principles of Humane Experimental Technique (Methuen & Co., Ltd., 1959). 48. Banks, R. E. e 4th R of research. Contemp. Top. Lab. Anim. Sci. 34, 50 51 (1995). 49. R Core Team. R: A language and environment for statistical computing (2022). 50. Darlington, R. B. Regression and Linear Models (McGraw-Hill

chunk 31 · 290 tokens

995). 49. R Core Team. R: A language and environment for statistical computing (2022). 50. Darlington, R. B. Regression and Linear Models (McGraw-Hill Companies, 1990). 51. Johnson, R. A. & Wichern, D. W. Applied Multivariate Statistical Analysis (Pearson Prentice Hall, 2007). 52. Nikaido, T., Sumitani, M., Sekiguchi, M. & Konno, S. e Spine painDETECT questionnaire: Development and validation of a screening tool for neuropathic pain caused by spinal disorders. PLoS One 13, e0193987 (2018). 53 Jolli e, I. T. Principal component analysis and factor analysis. In Principal Component Analysis (ed. Jolli e, I. T.) 150 166 (Springer, 2002). https:// doi. org/ 10. 1007/0- 387- 22440-8_7. 54. Wang, Q. & Guo, A. An e cient variance estimator of AUC and its applications to binary classi cation. Stat. Med. 39, 4281 4300 (2020).Author contributionsG.V.S. Conceptualization, Methodology, Formal analysis, Data visualization, Investigation, Writing original dra and Writing review & editing; G.M.P. Writing review & editing; B.G.P. Writing review & editing; S.P.L.L. Investigation and Writing review & editing; M.D.P.G. Investigation and Writing review & editing;

chunk 32 · 440 tokens

10 Scientific Reports | (2023) 13:21237 | https://doi.org/10.1038/s41598-023-48551-1 P.H.E.T. Conceptualization, Methodology, Investigation, Project administration, Supervision, Writing original dra and Writing review & editing. All authors reviewed the manuscript.Funding e funding was supported by Coordenação de Aperfeiçoamento de Pessoal de Nível Superior, 001, 002.Competing interests e authors declare no competing interests.Additional informationSupplementary Information e online version contains supplementary material available at https:// doi. org/ 10. 1038/ s41598- 023- 48551-1.Correspondence and requests for materials should be addressed to P.H.E.T.Reprints and permissions information is available at www.nature.com/reprints.Publisher s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional a liations. Open Access is article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. e images or other third party material in this article are included in the article s Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article s Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.© e Author(s) 2023