Behavioral and nociceptor states of inflammatory pain across timescales in 2D and 3D

Inflammatory pain represents a complex state involving sensitization of peripheral and central neuronal signalling. Resolving this high-dimensional interplay at the cellular and behavioral level is key to effective therapeutic development. Here, using the carrageenan model of local inflammation of the hind paw, we determine how carrageenan alters both the physiological state of sensory neurons and behaviors at rapid and continuous timescales. We identify higher excitability of sensory neurons innervating the site of inflammation by profiling their physiological state at different time points. To identify millisecond-resolved sensory-reflexive signatures evoked by inflammatory pain, we used a combination of supervised and unsupervised algorithms, and uncovered abnormal paw placement as a defining behavioral feature. For long-term detection and characterization of spontaneous behavioral signatures representative of affective-motivational pain states, we use computer vision coupled to unsupervised machine learning in an open arena. Using the non-steroidal anti-inflammatory drug meloxicam to characterize analgesic states during rapid and ongoing timescales, we identify a return to pre-injury states of some sensory-reflexive behaviors, but by and large, many spontaneous, affective-motivational pain behaviors remain unaffected. Taken together, this comprehensive exploration across cellular and behavioral dimensions reveals peripheral versus centrally mediated pain signatures that define the inflamed state, providing a framework for scaling the pain experience at unprecedented resolution. Highlights Automated identification of millisecond-resolved behaviors that separate inflammation-induced mechanical allodynia versus hyperalgesia. Sensory neurons innervating the inflamed paw show heightened excitability and nociceptive channel activity. Automated identification of spontaneous inflammation-induced behaviors uncovered by computer vision/machine learning during exploratory behavior in an open arena. Reduction in evoked pain signatures by an anti-inflammatory drug does not equal return to pre-injury state.


Introduction
Pain driven by insults generating strong inflammatory responses represents a major unmet health burden. Heightened nociception during periods of inflammatory pain is protective, serving to promote repair and recovery (Smith and Lewin, 2009). However, during chronic inflammatory diseases such as rheumatoid arthritis or osteoarthritis, prolonged periods of heightened nociception do not confer biological advantages, but rather unmitigated suffering. Despite this, approved therapeutic options for treating the pain associated with inflammation are often inadequate or accompanied by undesirable side effects (Ghouri and Conaghan, 2019; Woodcock, 2009). Development of novel therapeutics will rely on a greater understanding of the complexities underlying pain, from cellular and molecular changes within the nociceptive system to the behavioral level. Preclinical rodent models of inflammatory pain provide an entry point to address this problem. In attempting to discover genes and neural circuits that drive inflammatory pain in mice, it is necessary to investigate the dynamic interplay from nociceptor sensitization, through to the highly nuanced behaviors that result from altered neural activity, and this should be conducted in a cohesive experimental framework.
The physiological state of the nociceptor is a cardinal driver of inflammatory pain, with numerous studies demonstrating greater excitability of sensory neurons following exposure to inflammatory mediators (Davidson et al. 2014). The use of retrograde tracers permits identification of the neurons innervating a particular area of the body, thus enabling greater resolution of the functional and expression changes induced with inflammation by focusing on the cells projecting to the afflicted area (Chakrabarti et al. 2018). In terms of behavior, traditional methods for studying the pain status of rodents often rely on evoked pain measures, whereby the degree of pain experienced by subjects is inferred from their latency to respond to the application of a noxious stimulus (Barrot 2012). Such approaches have been criticized for not fully capturing the nature of pain in humans and their poor correlation with how pain is assessed in the clinic (Mao 2012). Thus, more objective and comprehensive tools to study animal behavior are necessary. Recent advances in computer vision and machine learning have led to the development of more unbiased techniques to monitor evoked animal response such as PAWS (Pain Assessment at Withdrawal Speed) (Jones et al. 2020) and B-SOiD (Behavioral Segmentation of Open-Field in DeepLabCut). Both techniques utilize high-frame rate videography to detect subtle micro-movements animals perform in response to innocuous or noxious stimulation, followed by analysis of rich data sets by supervised or unsupervised machine learning algorithms. MoSeq (Motion Sequencing) represents a complementary technology using a slightly different approach (Wiltschko et al., 2015). 3D vision is applied to observe an animal's spontaneous behavior in its entirety, followed by unsupervised machine learning to extract the dozens of motion sequences or syllables that make up mouse body language. The overall goal of the work described here is to utilize multiple dimensions of analysis -from the physiological state of the sensory neuron to complex behaviors, to uncover novel features that define the inflammatory pain state in mice.
Local application of carrageenan is one of the most widely used models of inflammatory pain in preclinical rodent models. Intraplantar injection of carrageenan into the hind paw induces robust edema within four hours (Morris 2003), whereas heightened sensitivity to both thermal and mechanical stimuli appears to persist for at least a day (Hargreaves et al. 1988;Buisseret et al. 2019). To date, studies characterizing the carrageenan model and assessing the efficacy of therapeutic agents have mostly relied on histological analyses and pain behavioral assays that focus on latency to paw withdrawal or withdrawal threshold (Pritchard et al. 2016;Rock et al. 2018;Buisseret et al. 2019;Miyake et al. 2019). With this rather limited level of characterization of a complex state, what prominent features of inflammatory pain in rodents might have gone undetected? Since pain encompasses molecular, cellular, and highly specific behavioral signatures, or "modules" -to fully understand the inflammatory pain state for assessing novel points for therapeutic intervention, a multidisciplinary approach is needed.
Here, we utilize PAWS, B-SOiD and MoSeq for fine-resolution behavioral mapping alongside whole-cell electrophysiology recordings and immunohistochemistry analyses of sensory neurons innervating the site of inflammation. We determined that retrograde labeled sensory neurons innervating the hind paw show decreased action potential threshold and greater magnitude voltage-gated inward currents in the hours immediately following carrageenan-induced inflammation. In terms of heightened sensitivity to mechanical stimuli during inflammation just seconds after stimulus delivery, we identify increased paw guarding as a prominent feature, with unique paw guarding behaviors for application of innocuous versus noxious stimuli. Through computer vision coupled to machine learning, we uncover sets of spontaneous behavioral syllables representative of pain and pain relief states in freely moving mice, as well as behavioral modulation with the analgesic drug meloxicam at baseline, in the absence of injury. Lastly, we demonstrate that analgesic pain relief as revealed by rapid paw movements captures only a subset of pain state, and may not represent a true return to basal conditions. This surprising result has major implications for testing the clinical efficacy of new analgesics when only using traditional paw withdrawal approaches to measure pain.

Carrageenan induces transient changes in paw swelling and weight bearing but evokes prolonged thermal hyperalgesia
Carrageenan-induced inflammation has been widely studied by neuroscientists and immunologists, usually coupled with evoked pain behaviors and/or gait analysis to identify new analgesic targets. Indeed, such approaches, as summarized in Figure 1A, have demonstrated that independent administration of prostaglandin D2glycerol, cannabinoids and ivabradine all alleviate evoked pain behaviors in rodents following induction of inflammation with carrageenan (Buisseret et al., 2019;Miyake et al., 2019;Rock et al., 2018). However, since many patients still have poorly treated pain driven by inflammation, this suggests that additional signatures need to be identified in rodent models that might serve as new analgesic targets. As a starting point in our studies, we began by focusing on traditional metrics of measuring carrageenan-induced inflammation, for future comparison to the new experimental pipeline developed here.

Thermal
hypersensitivity, a hallmark of inflammatory pain, was assessed at baseline, 4hours post-carrageenan injection, considered to be an acute pain state and 24-hours post-carrageenan when mice traditionally exhibit peak inflammation-induced hypersensitivity. Hargreaves measurement of heat hypersensitivity shows that mice develop acute (4-hours post-injection) and longer-lasting (24-hours post-injection) heat hypersensitivity of the carrageenan injected paw compared to the contralateral paw ( Figure 1E). Although heat sensitivity thresholds are significantly altered at both time points compared to baseline sensitivity (pre-carrageenan, 17.4 ± 0.43 s, 4-hours, 4.76 ± 0.34 s, 24-hours, 4.92 ± 0.28 s, p < 0.0001, ANOVA with Bonferroni post-hoc, Figure 1E), Hargreaves is not sensitive enough to distinguish between acute and longer-lasting pain at 4-hours and 24-hours post injection (4-hours, 4.76 ± 0.34 s, 24-hours, 4.92 ± 0.28 s, Figure 1E). We next sought to expand assessment of mouse behavior using dynamic weight-bearing. The observed swelling corresponded to reduced weight loading through the rear paw for the injected side after 4-hours (pre-inflammation, 27.26 ± 2.74%, 4hours, 19.27 ± 6.55%, p < 0.05, ANOVA with Bonferroni post-hoc, Figure 1F), but not 24-hours after carrageenan injection (pre-inflammation, 27.26 ± 2.74%, 24-hours, 27.94 ± 9.97%, Figure  1F). This finding coincided with mice placing more weight through their front paws relative to their rear paws at the 4-hour time-point (preinflammation, 0.24 ± 0.11, 4-hours, 0.67 ± 0.51, p < 0.01, ANOVA with Bonferroni post-hoc, Figure  1G), the distribution of weight-bearing more closely resembled pre-inflammation levels after 24hours of inflammation (pre-inflammation, 0.24 ± 0.11, 24-hours, 0.27 ± 0.21, Figure 1G). The proportion of time animals spent rearing, an explorative stance relying on significant weightbearing through the rear paws, was reduced 4hours after injection of carrageenan (preinflammation, 60.27 ± 11.26%, 4-hours, 23.73 ± 18.25%, p < 0.001, ANOVA with Bonferroni posthoc, Figure 1H). Again, the time animals spent rearing 24-hours after induction of inflammation was more comparable to pre-inflammation measures (pre-inflammation 60.27 ± 11.26%, 24hours, 56.27 ± 22.12%, Figure 1H). These findings build upon previous reports of mechanical and thermal allodynia following induction of inflammation with carrageenan, demonstrating a weight-bearing deficit that correlates with the peak of physical inflammation and longer-lasting thermal hypersensitivity. Having expanded basic understanding of carrageenan-induced inflammation, we next sought to identify new biobehavioral signatures in the carrageenan model using our refined pipeline summarized in Figure 1I.

Inflammatory
pain sensory-evoked behavioral modules uncovered at millisecond resolution with a supervised approach To determine sensitivity to mechanical stimuli during heightened pain states, traditional approaches use application of von Frey hair filaments and record the animal's response or lack thereof. In such cases, increased or decreased mechanical sensitivity can be observed but mechanical allodynia and/or hyperalgesia, whether innocuous stimulation becomes painful or noxious stimulation becomes even more painful, respectively, are very difficult to unambiguously disentangle. Moreover, other important behavioral features of heightened pain states may go unnoticed with a sole focus on paw withdrawal frequency or threshold. To provide added resolution, we recently developed an open-source automated pain scale with custom software called PAWS (Pain Assessment at Withdrawal Speeds) that takes high-frame rate behavioral data to quantify rapid reflexive behaviors and defensive coping behaviors like paw guarding and shaking (Jones et al., 2020). Here, we deployed PAWS in the carrageenan inflammatory model, seeking to uncover behavioral modules that may have gone undetected with traditional approaches.
We followed the same experimental timeline described above and recorded animal behavior at 2,000 frames per second (fps) with a focus on the carrageenan injected paw at baseline, as well as 4and 24-hours after paw injection. We used the ProAnalyst program for paw tracking, followed by analyzing the videos using the PAWS software ( Fig. 2A-C). Using the dynamic brush stimulus that predominantly activates large diameter mechanoreceptors (Abdus-Saboor et al., 2019), we do not observe any significant differences across timepoints in reflexive behavioral features that occur just after stimulus onset (Fig. 2D). However, coping behaviors, such as paw shaking and paw guarding, more commonly associated with affect, do show an increase after carrageenan injection, most notably paw guarding behavior (Fig. 2E). With the application of the mildly noxious light pinprick stimulus, which chiefly activates nociceptors (Abdus-Saboor et al., 2019), we observe an identical pattern to that observed with the dynamic brush. Reflexive behavioral features remain unchanged after carrageenan injection, whereas the affective behavioral features, namely paw guarding is upregulated (Fig. 2F). Moreover, we find that according to the type of stimulus, the elicited-guarding duration occurs in an intrinsic time-specific fashion. Indeed, while paw guarding duration evoked by dynamic brush is significantly increased as early as 4-hours post-injection (Wilcoxon matched-pairs signed rank test: 4-hours vs baseline p < 0.05 0.020; 24-hours versus baseline p < 0.05), paw guarding duration evoked by light pin prick is singularly upregulated at 24-hours post-inflammation (Wilcoxon matched-pairs signed rank test: 4-hours versus baseline p=ns; 24h versus baseline p <0.05). Taken together, these data demonstrate in an unbiased and automated fashion, that carrageenan-induced sensitization does not alter the speed or height in which an animal retracts its paw to mechanical stimuli. Rather, this immunogenic compound specifically alters the responses to mechanical stimuli such that defensive coping behaviors are more frequent. These results suggest that the neural circuits that drive paw guarding are specifically sensitized by carrageenan.

Unsupervised detection of rapid pain behavior signatures during inflammation
The PAWS platform takes high frame rate videography data and measures pre-defined intuitive features that have meaning to pain researchers (Jones et al., 2020). However, top-down approaches may perpetuate a user bias. Moreover, there may be paw dynamic features during inflammatory pain, discoverable by unsupervised approaches, that may reside below the level of easy experimenter detection. To address this, we employed B-SOiD, an unsupervised machine learning algorithm that parses spatiotemporal patterns from position data (Hsu and Yttri, 2021). For accurate comparison, we used the same highspeed behavioral data collected in Fig. 2. As inputs, we used two positions within the hind paw and two reference points as identified with the deep neural network DeepLabCut (Fig. 3A, see Methods). B-SOiD then identified and extracted unique clusters constituting conserved motor responses to these stimuli ( Fig. 3B; categorical names were assigned to clusters after the fact). Importantly, the behaviors were identified without any knowledge beyond point position, and the B-SOiD model developers were blinded to stimulus identity and treatment group. Eleven sub-clusters were found in both stimulation contexts, and we observed changes in response to stimuli beginning at 4-hours post-injection (Fig 3C-G). For example, carrageenan injection led to increased guarding across stimuli as well as a lift-to-hover pattern that was quantified as a distinct behavioral module Figure 2. PAWS automated pain assessment platform detects increase in defensive coping behaviors following carrageenan injection. A) A behavioral response to a somatosensory stimulus at baseline. (B) Post-carrageenan injection mice guard the paw in the air for extended time. (A,B) Green lines show paw trajectory pattern across entire behavior, and mouse image shows single frame with paw at its apex. (C) Image drawn in Biorender and modified from Jones et al., 2020. PAWS software measures paw height, velocity, shaking, and guarding in X and Y axes. Reflexive behaviors occur before paw reaches its apex (t*), whereas affective behaviors occur after t*. (D,E) No behavioral changes detected in reflexive features with dynamic brush comparing baseline to 4 and 24hour post-carrageenan injection, whereas affective features such as paw guarding are upregulated. (F,G) No behavioral changes detected in reflexive features with light pinprick comparing baseline to 4 and 24hour post-carrageenan injection, whereas affective features such as paw guarding are upregulated. N=10 mice per group and Wilcoxon matched-pairs sign rank test was performed to determine statistical significance. * p < 0.05, ** p < 0.01, *** p < 0.001, **** p < 0.0001 from guarding. The hovering pattern can be observed in traces of a representative video where the stimulated paw height is above zero (red line), while the speed is at zero (black line) ( Figure 3C right panels), and when repeated, appears analogous to shaking.
These behaviors and distributions are similar to those observed by human raters and top-down supervised approaches -though differ in some important aspects. The automated behavioral assessment extracted two guarding types specific to the foot stimulus presented (i.e. angled versus flat guard). These phenotypes were present across animals and both the 4-and 24-hour time points and were distinct from each other in both height and foot posture. Since the "angled guard" (paw lifted and perpendicular to the surface) was upregulated with the innocuous stimulus, this might be a behavior specific to touch neurons and thus mechanical allodynia. Conversely, the "flat guard" was upregulated with the noxious stimulus (paw lifted and parallel to the surface), and might be associated specifically with nociceptors and mechanical hyperalgesia. To date, there are no behavioral signatures beyond the discovery here that allows researchers to distinguish mechanical allodynia versus mechanical hyperalgesia. Taken together, an unbiased and agnostic algorithm can extract reliable behavioral modules generated by inflammatory pain, and moreover, it can provide valuable information about sensitization of the underlying neural circuits.

MoSeq detects spontaneous behavioral signatures of carrageenan-induced inflammation
Although evoked behavioral measurements provide one critical domain of the pain neuroaxis, spontaneous bouts of pain are what chronic pain patients experience most frequently (Ott and Maihöfner, 2018). To date, the majority of inflammatory pain behavioral measurements in rodents have only proxied evoked measurements, which greatly limits the translational impact of our rodent models. Understanding how molecules and circuits influence pain requires the ability to objectively organize information about similarities and differences within complex pain behavior datasets. Recent advances in computer vision and machine learning allow us to do this more efficiently. Using the previously described MoSeq technology (Wiltschko et al., 2015;, we explored whether carrageenan-induced inflammatory pain affects spontaneous animal behavior in a meaningful way that can be detected by MoSeq. Singular measurements such as paw withdrawal latency to a stimulus, including the Hargreaves thermal assay, do not provide adequate resolution to separate potentially disparate behavioral states. Conversely, unsupervised analysis of micro-movements performed by freelymoving mice filmed in 3D from above (figure 4B) provides a rich dataset and an unbiased approach to the study of mouse spontaneous behavior. Here, we find that MoSeq automatically detects as many as 62 unique syllables or modules, the large majority of which were differentially utilized by animals at baseline compared to 4-hours and 24hours after carrageenan injection (heatmap Figure  4C). We classified these 62 syllables as representing one of four types of behavior: exploratory/escape behavior, grooming, pause and rearing. While exploratory behavior is mainly unaffected, probably on account of the curious nature of mice, grooming and rearing behavior is strongly downregulated because of pain. For example, we found that rearing behavior (syllable 42, Figure  4D, E) is affected by carrageenan-induced inflammatory pain at 4-hours and 24-hours postinjection ( Figure 4D). This result suggests that this form of rearing behavior may cause heightened mechanical allodynia to animals and is therefore inhibited by inflammation. Of the 27 subtypes of pausing detected by MoSeq, about half are affected by inflammatory pain, either up or downregulated. Thus, inflammatory pain vastly alters the spontaneous display of behavior. Further linear discriminant analysis (LDA) of transition probabilities across time and pain states shows that MoSeq can detect an important behavioral transition in spontaneous behavior induced by inflammatory pain between the 4-hours and 24hour time points ( Figure 4F), which was undetected by Hargreaves ( Figure 1E shows that Hargreaves cannot separate inflammatory pain behavior at 4 versus 24hrs). The detection of this evolution in the pain state of the animal could have important implications as to the different neuronal networks involved at these two time points (peripheral versus more central) and prove crucial Colors of sub-clusters indicate their behavioral group assignment (red=at rest, green=lift, brown=hover, yellow=angled guard, blue=flat guard). (C) Representative responses to dynamic brush and (D) light pinprick at baseline, 4-hour, and 24-hour timepoints post-carrageenan injection. Responses are color-coded by the identified action type in panel (B), with speed (green) and height (black) on the left (both in arbitrary units). (E) Examples of the two forms of guarding identified by B-SOiD, which may be indicative of the activation of different subsets of sensory neurons (mechanoreceptors by brush, inducing angled guard, nociceptors by pinprick, inducing flat guard). (F) Distribution of behaviors observed across dynamic brush trials. (G) Distribution of behaviors observed across light pinprick trials. For F and G, sampling window is -25ms to 500ms relative to movement onset.
to efficient anti-inflammatory drug development. The mosaic of behavioral changes induced by inflammatory pain goes to show the complexity of mouse behavior and the need for unbiased approaches, like MoSeq and subsequent unsupervised analysis of the rich dataset it generates, to fully grasp what spontaneous and ongoing pain is made of.

Electrophysiological characterization of hind paw innervating sensory neurons reveals greatest excitability just hours following carrageenan injection
Having identified novel behavioral signatures of inflammatory pain at defined time-points, we next sought to determine if activity of site-relevant sensory neurons might correlate with some of the identified behaviors. Sensory neurons innervating the hind paw were identified with the retrograde tracer Fast Blue ( Figure 5A) and of acutely cultured lumbar DRG neurons (L2-L5) ~4.46% were found to be Fast Blue positive ( Figure 5B inset). The relative size distribution of the Fast Blue positive population closely resembled that of the total lumbar DRG ( Figure 5B), that is to say the hind paw is likely innervated by the full range of neuronal subtypes. Electrophysiological characterization of the Fast Blue populations cultured from the inflamed side (ipsilateral, ipsi.) and non-injected side (contralateral, contra.) revealed a lower rheobase (current injection necessary for action potential discharge) of ipsilateral neurons compared to contralateral neurons after 4-hours of inflammation suggesting the rapid onset of peripheral sensitization following exposure to carrageenan (contra., 272.1 ± 48.95 pA, ipsi., 125.1 ± 25.36 pA, p < 0.01, unpaired ttest, Figure 5C,E-F). No significant difference in rheobase was observed between ipsilateral and contralateral neurons at the 24-hour postinflammation time point (contra., 290.00 ± 61.61 pA, ipsi., 201.14 ± 37.74 pA, Figure 5C). After determining the rheobase, neurons were stimulated at suprathreshold (2X rheobase), neurons isolated from the ipsilateral side after 4-hours of inflammation had a higher tendency to fire multiple action potentials during this stimulation than those from the non-injected side (contra., 1.87 ± 0.47, ipsi., 3.00 ± 0.42, p = 0.1128, unpaired ttest, Figure 5D), no such difference was observed 24-hours post-inflammation (contra., 2.92 ± 0.58, ipsi., 2.65 ± 0.42). The neurons recorded from did not differ in any other intrinsic or active parameter measured for either time point, as summarized in Table 1.  Table 1 Intrinsic and active properties of hind paw innervating dorsal root ganglion neurons from the carrageenan injected side (Ipsi) and contralateral (Contra) side. Data are mean ± SEM. ** p < 0.01, unpaired t-test.
The higher excitability of sensory neurons observed at 4-hours post-injection of carrageenan correlates with the peak of physical inflammation, suggesting that mediators released during the inflammatory process may be responsible for sensitizing the neurons. As inflammation subsides, the levels of inflammatory mediators declines, and this corresponds with the degree of excitability of neurons from the ipsilateral side being more comparable to the contralateral side at the later 24-hour post-inflammation time point. Although the inflammatory peak has passed, changes in the expression of nociceptive channels that were initiated during the height of inflammation might begin to manifest and influence behavior at later time points. We thus assessed expression of TRPV1, an ion channel involved in detection of noxious heat, in whole sections of lumbar DRG (L3 and L4). Greater TRPV1 immunoreactivity was observed for sensory neurons innervating the inflamed hind paw compared to DRG isolated from the contralateral side (contra., 20.01 ± 1.87%, ipsi., 29.88 ± 3.80%, p = 0.0571, Mann-Whitney test, Figure 5G-H). This result likely explains our earlier observation of thermal hypersensitivity persisting at the 24-hours post-inflammation time point ( Figure 1E). Together, these results suggest an adaptation of the sensory neurons in response to the initial inflammatory insult which renders them more sensitive to noxious stimuli, even after the inflammation has subsided. In addition, since sensory neuron excitability decreases by 24-hours post-inflammation, but pain behavioral signatures persist (Figures 2-4), this suggests that central sensitization might drive pain states beyond the initial few hours. Step-wise current injections were used to determine the rheobase of hind paw innervating sensory neurons from injected (ipsi) and non-injected (contra) sides 4-or 24-hours post-induction of inflammation with carrageenan. (D) Frequency of action potential (AP) discharge following stimulation of sensory neurons with a suprathreshold (2X rheobase). Representative traces from step-wise current injections to determine rheobase of neurons from (E) contralateral and (F) ipsilateral sides 4-hours post injection of carrageenan. (G) A subset of hind paw innervating sensory neurons (blue) express the nociceptive ion channel TRPV1 (magenta), cells positive for both Fast Blue and TRPV1 are identified by yellow pointers, scale = 50 µm. (H) A higher proportion of hind paw innervating neurons expressed TRPV1 after 24-hours of carrageenan-induced inflammation. ** p < 0.01, unpaired t-test.
Meloxicam relieves hyperalgesia but MoSeq shows that this pain relief does not equal a return to baseline state.
Having analyzed how primary afferent input is altered, and thus can explain some, but not all of the behavioral changes we observed in the carrageenan inflammatory pain model, we next deployed MoSeq to determine its potential use in the development of effective analgesics. This is because a major current barrier in therapeutic development is the difficulty in assessing analgesia in an unbiased, rigorous and quantitative manner. First, as a benchmark to current analyses, we began by studying pain relief to carrageenan using the Hargreaves thermal assay. We compared the behavior of mice at 24-hour post-carrageenan injection following intraperitoneal injection of either saline or meloxicam, a non-steroidal antiinflammatory drug (NSAID) commonly used to relieve pain and inflammation in rodents, dogs, cats and humans (Busch et al., 1998) ( Figure 7A). As expected, Hargreaves assessment of heat sensitivity shows that meloxicam is efficient at significantly reducing carrageenan-induced heat hypersensitivity at the 24-hour timepoint ( Figure  7B, unpaired t-test 24-hour saline vs 24-hour meloxicam p<0.0001), though sensitivity is not quite back to baseline levels (unpaired t-test 24hour meloxicam ipsi vs contra p<0.01).
Before turning to MoSeq, we next returned to highspeed videography combined with the PAWS platform to measure pain relief with meloxicam following carrageenan hind paw injection. We injected carrageenan-inflamed mice with either meloxicam or saline at 22-hours and assessed their mechanical sensitivity using PAWS at baseline, 4hours post-carrageenan injection and 24-hours post-carrageenan intraplantar and compound intraperitoneal injection ( Figure 7A). Similar to our observations above, after inflammation, we observed significantly upregulated paw guarding duration evoked by 1) dynamic brush stimulation at 4-hours ( Figure 7C) (Wilcoxon matched-pairs signed rank test: 4h versus baseline, p <0.05) and 2) light pinprick stimulation at 24-hours postinflammation ( Fig 7D)  We were curious to see whether meloxicam affects the pain signature of spontaneous behavior in a manner similar to evoked sensory behavior, i.e. seemingly bringing animals back to baseline behavior, and used MoSeq to test this hypothesis. Linear discriminant analysis of the usage of the 62 syllables identified by MoSeq shows an interesting directional trend in the behavioral space occupied by mice at baseline, 4-and 24-hours after carrageenan injection, especially when comparing the very different space occupied by mice that have received either saline or meloxicam at 24-hours post-carrageenan injection ( Figure 8A, B). Interestingly, animals that received meloxicam at 24-hours do not seem any closer in space to the baseline group than the 24-hour saline control group. That is, conversely to sensory evoked behavior, meloxicam does not appear to show pain reversal in terms of spontaneous behavior ( Figure   7F). Rather, mice that received meloxicam after injury seem to be in an entirely different "space". This unexpected finding led us to question whether meloxicam can also alter baseline behavior in the absence of pain. While Hargreaves results suggest meloxicam has no effect on the sensory threshold of the uninjected contralateral paw ( Figure 7B), MoSeq shows that meloxicam drastically affects spontaneous behavior even at baseline when administered in absence of an underlying pain condition ( Figure 7E, F).
We noticed that LDA representations of raw syllable usages ( Figure 8A) and transition probabilities ( Figure 8B) are slightly different, the pharmacobehavioral groups are more segregated in space when plotting transition probabilities. To better understand and interpret how MoSeq might aid in evaluating analgesic efficacy, we decided to apply standard sequence classification techniques (Le and Mikolov, 2014) to MoSeq data to extract syllables or sets of syllables which best represent a particular experimental group (baseline, 24-hour F saline or 24-hour meloxicam pain relief, for example). These methods embed long sequences (e.g., the raw MoSeq data produced by one animal) in a representational space where sequences having similar co-occurrence structure (pairs of syllables, triples of syllables, etc.) tend to cluster. Consequently, these embeddings depend on contextual information which is potentially more powerful than simple transition probabilities and is simply absent in usages. To evaluate the relative predictive powers of usages versus transition probability versus learned embeddings, we trained three classifiers to predict experimental groups from each type of representation. We found that the context-dependent, learned embeddings were substantially more predictive of experimental groups than raw usages or transition probabilities (72.5 % accuracy for raw usages; 85 % accuracy for transition probabilities; 87.5 % accuracy for learned embeddings; full confusion matrices depicted in Fig. 8C, C, E).
Crucially, the learned embedding method associates to each point in the embedding space a distribution over syllables. This is gradually shaped through training to indicate behaviors associated to each embedded sequence (i.e., to each animal) and plotting these distributions per animal after training gives Figures 8F, G. While LDA representation of raw syllable usage or transition probabilities can give us a global idea of how mouse spontaneous behavior is affected by pain and pain relief across time, learned embeddings now provide us with the means to identify syllables that are most representative of each pharmacobehavioral state. For example, we can now identify syllables 23 and 60, a type of exploratory behavior and grooming respectively, as possibly representative of spontaneous behavior at baseline, but less so at 4hours post-carrageenan injection when the animal is in pain, and not at all at 24-hours. We also see that syllable 19, a head-up micro-movement, is representative of mice having received meloxicam either at baseline or at 24-hours post-carrageenan injection. When using this information to look at syllable usage, we find that this behavior is indeed significantly down-regulated in both groups compared to baseline, potentially highlighting a side-effect of meloxicam. In conclusion, we have identified the learned embeddings method as a crucial tool in order to extract biologically meaningful data from rich and complex MoSeq datasets. This type of analysis will act as a guide for the experimenter to identify specific behaviors representative of pain and pain relief states.

Discussion
Unilateral intraplantar injection of carrageenan evokes both mechanical and thermal hyperalgesia which persist for at least 24-hours (Hargreaves et al. 1988;Buisseret et al. 2019). Here, with videography across timescales followed by unbiased analyses using machine learning based algorithms, we identify evoked and spontaneous behaviors after induction of inflammation that were previously undetected with traditional methods for assessing nociception. Profiling sensory neurons directly innervating the site of inflammation revealed hyperexcitability after 4-hours of inflammation, which resolved to a basal level at the 24-hour time point. Moreover, expression of the heat-gated ion channel TRPV1 was elevated at 24-hours suggesting a longer-lasting adaptation of nociceptors following the inflammatory insult.
Noteworthy to the quest for discovering new analgesics, we determined that meloxicam driven pain relief does not equate to a full return to preinflammatory baseline state. Taken together, these data highlight the strength of this multidisciplinary approach for arraying the highdimensional pain biobehavioral space and offer a new experimental roadmap for the field.

Resolving the transition between responses at 4-versus 24-hours
A single injection of carrageenan produces localized inflammation which resolves within a day, but pain-like behavior that can persist for days. However, our multi-method pipeline shows that DRG neurons innervating the site of inflammation do not show signs of hyperexcitability 24-hours after inflammation. This suggests the persistent pain behaviours resolved with MoSeq, PAWS, and B-SOiD at the 24-hour time point are likely driven by adaptations in the nociceptive system initiated during active inflammation. Indeed we show an increase in the number of sensory neurons expressing TRPV1 24-hours post-inflammation and thus postulate that the sensory neurons exist in a hyperexcitable state, even as the inflammation subsides. Hence the observation of pain-like behaviours at both our early and later time points, which we have resolved through MoSeq and PAWS as distinct biobehavioral states. Another study identified a key role for the TRPA1 channel in mediating carrageenan-induced paw edema (Moilanen et al., 2012), suggesting that sensitization of several nociceptive ion channels likely contribute to the pain hypersensitivity state. It is also plausible that central sensitization contributes to the persistent pain observed 24hours after inflammation, although this could only be assessed through simultaneous recording of neurons in the brain and/or spinal cord.

Retrograde labelling allows interrogation of the cellular mechanisms driving biobehavioral states
Using the retrograde tracer Fast Blue we demonstrate higher excitability of sensory neurons innervating the inflamed hind paw after 4-hours of inflammation. Subsequent experiments exploring the activity of voltage-gated ion channels revealed a greater conductance of those channels permitting inward current in response to depolarisation, which may offer some explanation of the hyperexcitable state observed, as action potential discharge can be more readily achieved. The rapid onset of this change suggests a post-translational modification might be responsible, indeed phosphorylation of voltage-gated sodium channels by mediators released during inflammation, including prostaglandin E2 (PGE2), has been shown to increase inward currents (Gold et al., 1996). Considering that meloxicam inhibits cyclooxygenase activity and thus prostaglandin production, our finding that meloxicam reduced pain like behavior 4-hours post injection of carrageenan suggests a strong role of PGE2induced phosphorylation of voltage-gated sodium channels driving the hyperexcitability of sensory neurons and pain behaviours that manifest following induction of the carrageenan model. Furthering this, independent studies have reported induction of cyclooxygenase-2 during the hind paw carrageenan model and less pain-like behavior following induction of the model on mice deficient in the voltage-gated sodium channel NaV1.7 on nociceptors (Ibuki et al., 2003;Nassar et al., 2004). Using Fast Blue to identify the cell bodies of sensory neurons projecting to the inflamed hind paw we report an apparent upregulation of TRPV1 by lumbar DRG through immunohistochemistry after 24-hours of inflammation. Studies of TRPV1 knock-out mice have also reported less mechanical hyperalgesia following carrageenan-induced inflammation (Watanabe et al., 2015), we thus propose the observed increase contributes to painlike behaviours seen at 24-hours. Combining retrograde labelling with more sophisticated techniques such as single-cell qPCR or RNA sequencing would allow a more comprehensive assessment of the molecular state of sensory neurons during inflammation, removing the requirement of validated antibodies and in the latter case may represent an opportunity to identify novel players in inflammatory pain networks at the level of the sensory neuron.

Supervised and unsupervised learning approaches uncover behavioral signatures that can distinguish mechanical hyperalgesia and allodynia.
Using the PAWS platform, we determined that after carrageenan-induced hind paw inflammation, rapid reflexive behaviors related to how fast and high the withdrawn paw is moved, are unaltered. This finding likely reflects the fact that animals experiencing localized paw inflammation do not want to move their swollen paws robustly, which would facilitate ensuing pain. Conversely, with PAWS, we observe an upregulation of defensive coping behaviors like paw guarding to both innocuous and noxious mechanical stimulation. This result suggests that animals experiencing inflammatory pain are willing to engage in motor behaviors that have the potential to prevent further stimulation to the injured paw (i.e. guarding the paw in the air). The rapid reflexes are likely predominantly DRG and spinally mediated, whereas defensive coping behaviors have central components (Barik et al., 2018;Corder et al., 2019;Hua et al., 2020;Huang et al., 2019;Jones et al., 2020) in structures like the amygdala and brainstem. Moreover, recent studies uncovered an ascending spinoparabrachial pathway where Tacr1 or Gpr83 projection neurons can encode the negative valence associated with noxious stimuli (Choi et al., 2020). Based on our data presented here, we speculate that the carrageenan model might specifically sensitive molecularly-defined pathways such as these, and future studies are warranted to test this hypothesis.
Taken together, our results demonstrate that PAWS can accurately make a distinction between strictly reflexive and affective centrally-modulated behavioral responses to mechanical stimulation under pathophysiological conditions, both in a time-specific manner and with respect to sensory modalities. In addition, the B-SOiD unsupervised learning algorithm was able to identify variations of the guarding response that were specific to delivery of innocuous versus noxious stimuli. Future studies are needed to determine how animals engage unique paw motor patterns during inflammatory pain, but this must reflect something about the underlying neural circuits. To our knowledge, this is the first demonstration that the paw guarding coping mechanism is specific to given mechanosensory modalities and nuanced yet robust paw position dynamics allow the fine distinction between dynamic mechanical allodynia and mechanical hyperalgesia.

Unsupervised 3D pose dynamics show spontaneous pain signatures
Gait analysis shows that weight bearing of the injected paw is significantly affected at the 4-hour time point after carrageenan injection but not at the 24-hour time point, suggesting that either the pain has started to recede, which is contradicted by evoked pain measures, or the animal has adapted somewhat to the pain state. Interestingly, MoSeq analysis of the animal's spontaneous behavior also shows two distinct trends in how the establishment of pain affects usage of specific syllables. While animals use certain micromovements less and less (or more and more) as hyperalgesia progresses, other syllables usage shows rather a U-shaped curve. The fact that the usage of certain movements is most affected during the acute phase and tends to revert back to preinjury levels at 24-hours suggests adaptation of motor behavior to pain. Comparing rearing behavior in a cylinder over a few minutes to the deeper analysis provided by MoSeq outlines well this dichotomy. While overall time spent rearing at 24-hours post-carrageenan injection looks similar to baseline, freely moving mice filmed for 20 minutes will actually show different types of rearing behavior, some of which are only affected at 4-hours by pain, while others are significantly down-regulated at both 4-and 24-hours.
Our analysis of predicted syllables per group shows that each pharmacobehavioral state (baseline state, different pain states, pain relief...) has a distinct signature. Interestingly, while meloxicam relieves hyperalgesia entirely when we use evoked sensory tests to assess pain relief, we see that its effect on spontaneous behavior is more subtle and that mice injected with either saline or meloxicam at 24-hours post-carrageenan injection still share common predicted syllables. Hence, similarly to RNA sequencing of neurons, where a neuronal subset is not defined by one specific gene but rather by a set of genes of varying levels of expression, the signature of a pharmacobehavioral space is really a set of behavioral syllables characterized by their levels of usage. Our comparisons of the predictive power of raw syllable usage, transition probabilities between syllables or learned representations highlights an interesting point about how these different parameters can be used to extract the most representative set of data. When tested on a leaveone-out cross-validation, we find that using learned embeddings gives a significantly more descriptive representation of our datasets than syllable usage or transition probabilities. But these approaches are actually complementary because while LDA representation of usages or transitions gives us a broad picture of how behavior is impacted by pain and pain relief, learned embeddings allow us to identify in a meaningful and biologically relevant way the micro-movements most representative of pain and analgesic states. We can then use how these micro-movements as a tangible readout of the analgesic potential of new drugs.

What is analgesia?
Analgesia is broadly defined as a lack of pain or an insensitivity to pain, and the International Association for the Study of Pain describes both a sensory and an emotional component to the experience of pain. Hence, analgesia could be defined as a relief of both sensory-evoked and ongoing emotional pain, but is that the same as a return to pre-injury state or a different state altogether?
Mice are hypersensitive to heat and pinprick at 4and 24-hours post-carrageenan injection and this hyperalgesia is entirely relieved by meloxicam, which may seem like a return to a pre-injury state. However, Motion Sequencing shows that this evoked pain relief does not equal a return to baseline spontaneous behavior, rather this is an entirely different state and though meloxicam relieves hypersensitivity to noxious stimulation, it does not bring the animal back to a pre-injury behavioral state, nor probably a pre-injury internal state. While MoSeq analysis of mouse spontaneous behavior uncovers aspects of pain and pain relief that cannot be identified through evoked sensory testing alone, the internal state of the animal is still a mystery and it would be interesting to investigate further.
One of the most surprising findings of our study is the drastic effect at baseline of an antiinflammatory drug widely used on animals, as shown by Motion Sequencing of their spontaneous behavior. Prostaglandins are well known mediators of acute inflammation, and recent studies also suggest a role in the transition from acute to chronic inflammation (Aoki and Narumiya, 2012). Meloxicam is a non-steroidal anti-inflammatory drug widely used in research laboratories using rodent models, as well as in the clinic, to reduce pain and fever symptoms of inflammatory pain by reducing inflammation-induced prostaglandin synthesis.
Less inflammation-induced prostaglandin synthesis translates into lesser sensitization of the nerve fibers innervating the injury site, as well as the central nervous system. This is in line with the mechanical and thermal hypersensitivity relief we see using evoked pain tests, seemingly bringing animal sensitivity almost back to baseline levels. Our analysis of spontaneous behavior and representation of the results in 3D space however tells a different story. Following meloxicam injection, although mice show evoked pain relief, they are in a very different pharmacobehavioral state compared to baseline. This suggests that while sensory-evoked pain might be relieved, there is an ongoing affectivemotivational component at play that is altered in an unexpected way by meloxicam. For this reason, and because many people could assume a lack of effect of an anti-inflammatory drug in the absence of inflammation, we decided to evaluate whether meloxicam affects spontaneous behavior pre-injury through MoSeq. We found that spontaneous mouse behavior is significantly affected by meloxicam at baseline, and in many ways, this effect is even more drastic at baseline than in a pain context. While in a pain state meloxicam mainly inhibits the inflammation-induced activity of the prostaglandin-endoperoxide synthase COX-2, the constitutive activity of the COX-1 isoform is also affected. We suggest that this is one of the mechanisms underlying the effect of meloxicam at baseline. Considering the power of MoSeq in representing evolving pain states, it will be interesting to use this technology to follow the timeline of other more complex rodent pain models, but also to test the analgesic potential of drug candidates and redefine what we call analgesia.

Animals (Rutgers University)
Male mice of C57BL/6J background were used for behavioral analyses. Testing was done beginning at 7 weeks of age and completed by 12 weeks of age. All animals were group housed. Animal numbers per group for behavioral tests are indicated in figures. All procedures were approved by the Rutgers University Institutional Animal Care and Use Committee (IACUC; protocol #: 201702589). All mice used in experiments were housed in a regular light cycle room (lights on from 08:00 to 20:00) with food and water available ad libitum. 20 µl 3% (w/v) λ-Carrageenan (Sigma-Aldrich) in PBS 1X was injected into the mouse left hind paw using a Hamilton syringe. Thermal hyperalgesia was assessed at baseline and 6-and 26-hours postcarrageenan injection. The uninjected right hind paw served as a control. Saline or meloxicam (5mg/kg, Henry Schein Animal Health) was injected intraperitoneally 22 hours postcarrageenan injection (2 hours before MoSeq, 4 hours before Hargreaves).

Animals (University of Cambridge)
Experiments performed in Cambridge UK (dynamic weight bearing, electrophysiology and immunohistochemistry) were regulated under the Animals (Scientific Procedures) Act 1986 Amendment Regulations 2012. The University of Cambridge Animal Welfare and Ethical Review Body also approved all animal experiments. Cutaneous afferents innervating both hind paws of male C57BL/6J mice were labelled with the retrograde tracer Fast Blue (2% w/v in sterile PBS; Polysciences) when animals were aged 9 weeks. 3 x 1 µl injections were made to the lateral, central and medial plantar aspects of each hind paw under anaesthesia (intraperitoneal delivery of ketamine, 100 mg/kg and xylazine, 10 mg/kg) as previously described (da Silva Serra et al., 2016). 5-7 days after retrograde labelling, the right hind paw of mice was inflamed by injection of 20 µl 3% (w/v) λ-carrageenan (Sigma-Aldrich), inflammation was induced while mice were under inhalation anaesthesia (2% isoflurane). The diameters of each ankle and foot pad were measured with digital callipers before and 4-or 24hours post inflammation. 5 animals were used for each time point for electrophysiology experiments, a separate cohort of 4 animals were used for immunohistochemistry experiments.

Animals (University of Pennsylvania)
Mice for behavior testing were maintained in a barrier animal facility in the Carolyn Lynch

Sequencing (MoSeq): Motion Sequencing
Depth data were modelled as previously published (Wiltschko et al., 2015). First, raw depth frames were collected from a Microsoft Kinect, mounted above the arena, using custom acquisition software written in C#. Frames were collected at 30 Hz, and each frame was composed of 512 x 424 pixels, where each pixel contained a 16-bit integer specifying the distance of that pixel from the sensor in mm. After each session, frames were gzip compressed and moved to another computer for offline analysis. The mouse's center and orientation were found using an ellipse fit. Then, an 80 x 80 pixel box was drawn around the mouse, and the mouse was rotated to face the right hand side. Next, if the tracking model was used, missing pixels were identified by their likelihood according to the Gaussian model. Low-likelihood pixels were treated as missing data and principal components (PCs) are computed using probabilistic PCA (Roweis, 1998;Tipping and Bishop, 1999). Finally, frames were projected onto the first 10 PCs, forming a 10 dimensional time series that described the mouse's 3D pose trajectory. These data were used to train an autoregressive hidden Markov model (AR-HMM) with 3 lags to cluster mouse behavioral dynamics into discrete ''syllables,'' with state number automatically identified through the use of a hierarchical Dirichlet process. Each state was comprised of a vector autoregressive process that captures the evolution of the 10 PCs over time. The model was fit using Gibbs sampling as described in (Wiltschko et al., 2015) using freely available software (https://github.com/mattjj/ pybasicbayes). Model output was insensitive to all but two hyperparameters, which were set using unsupervised techniques for determining the length scales for discrete behaviors as was previously published (Wiltschko et al., 2015).

Motion Sequencing (MoSeq): Behavioural usage and transition matrix analysis
Syllable usage was calculated by summing the number of occurrences of each syllable and dividing by total syllable usage across a recording session, converting syllable usage into a percentage. The number of syllables used for each analysis was based on the syllable usage across all sessions within a condition. Transition matrices were calculated by counting the total number of occurrences syllable A transitions into syllable B (for all syllables).

Motion Sequencing (MoSeq): Behavioral Linear Discriminant Analysis
Linear Discriminant Analysis (LDA) was performed using the scikit-learn implementation.
Individual normalized usage or bigram transition probabilities were fed to the LDA model, including group labels, and fit to either 2 or 3 components using the eigen solver and an empirically found shrinkage value. Results were then plotted with seaborn and matplotlib.

Learned Embeddings of Syllable Sequences
Each animal was represented as a doc2vec ("document to vector") embedding [1] using the Gensim software package [2], version 3.8.3, in Python 3. To that end, each animal and each syllable was first encoded uniquely as a one-hot vector of 164 (80 animals + 64 syllables; four syllables of the 68 total were removed for occurring fewer than 10 times on average in the raw sequences) dimensions. These one hot vectors were mapped by a linear transformation to an ndimensional embedding space. The linear transformation was adapted by stochastic gradient descent using two losses, resulting in two embeddings. Following [1], the two embeddings for each animal were concatenated to produce the final animal representation. The first embedding was learned by 1) randomly sampling an animal and a single syllable from its raw behavioral sequence, 2) mapping them to an n=100 dimensional embedding space, 3) averaging the animal and syllable embeddings, 4) mapping the average to the 64-dimensional space of probability distributions over syllables, and 4) predicting from this output distribution either the previous syllable or next syllable in the raw sequence. The embedding space was adapted to improve accuracy in this syllable prediction task. In the parlance of doc2vec methods, this corresponds to a "distributed memory" (DM) embedding with a window size of 1. The second embedding was learned using only representations of animals (no syllable embeddings), by first randomly sampling an animal together with a 10-syllable subsequence in its raw behavioral sequence and mapping the animal to an n=50 dimensional embedding space. The animal embedding was then mapped to the 10x64 dimensional space of distributions on 10syllable subsequences, from which random syllables in the sampled subsequence window were predicted. The embedding space was adapted to improve the accuracy of this subsequence prediction task, which also helps the embedding encode higher order information beyond neighboring syllables in the raw sequence. We refer to this as a "distributed bag of words" (DBOW) embedding. Again, the final embedding for each animal to be used in classification was the concatenation of DM and DBOW embeddings.
We determined by inspection that the default doc2vec hyperparameters ultimately produced the best classifier performance. The model was trained over 150 epochs, and each epoch consisted of one gradient descent update for every 2-syllable window for every animal in the DM representation and every 10-syllable window for every animal in the DBOW representation. Both the number of training epochs and the embedding dimension are nonstandard for doc2vec applications, but they nevertheless produced the best classifier results. 150 epochs is longer than in other applications since we are only concerned with overfitting at the classifier stage (e.g. there is no testing data for the learned embeddings). There is also the danger of overfitting from using more embedding dimensions than total syllables (100 vs 64) in the DM model. We circumvent this problem since the DM model has 80 additional data in the form of animals so that the eventual joint DM/DBOW embedding is less susceptible to overfitting.
There are several ways to associate to each embedding a characteristic syllable or sequence of syllables. One way, not explored here, is to use the syllable embeddings produced by the DM representation and calculate some similarity metric (cosine similarity, Euclidean distance, etc.) between a syllable embedding and an animal embedding. Instead, to provide a richer association between animals and characteristic behaviors, we modified the Gensim source code to expose the mapping from the embedding space to the 64dimensional syllable space used during training in the DM model. This mapping can now be interpreted as an association between an animal representation and a distribution of syllables. This association was fairly stable over hyperparameters and high classifier performance was associated with strongly peaked associated syllable distributions. The presented method is a proof of a concept for the viability of sequence embedding methods for the explanation of animal behavior, and future work could cross-reference "explanatory" syllables against ethological prior knowledge and use these syllables to make concrete behavioral hypotheses.

Analysis of Animal Representations
We used a machine learning classifier to compare the expressive power of three types of animal representations: syllable usages, syllable transition probabilities, and learned embeddings. Our goal here was to predict which of the five experimental manipulations an animal received from each of these representations. By design, the dimensionality of each representation is different (68 vs 150 vs 68x68=4624), but can be truncated to make a fair comparison. In general, the higher the dimension of the data, the easier it will be to classify since more dimensions give more degrees of freedom for a learned decision boundary. To start, we fixed the representational dimensions at their normal values, giving transition matrices a massive advantage. We trained an identical, unregularized, 5-class logistic regression classifier on each type of representation using leave-one-out crossvalidation. The classifier was trained in scikit-learn in Python 3. The classifier was trained with a stopping criterion of 1e-5 and with balanced class correction. In this setting, the average validation accuracy for the usages, transitions and embeddings were 72.5% 85% and 87.5%, respectively. If we fix the dimensions of representations to all be 68 (taking the 68 most frequent transitions and setting n=34 for the embeddings), the accuracies associated to transitions and embeddings drop by 22.5% (to 62.5%) and 10% (to 77.5%), respectively. This shows that the learned embeddings not only perform the best with the standard representational dimensions, but are also the most efficient of the three tested representations. We can hypothesize consequently that there are experimental effects which differentiate the groups which manifest at longer behavioral scales (beyond one-step transitions).

Behavior: Hargreaves Assay
To assess hind paw heat sensitivity, Hargreaves' test was conducted using a plantar test device (IITC). Mice were placed individually into Plexiglas chambers on an elevated glass platform and allowed to acclimate for at least 30 minutes before testing. A mobile radiant heat source of constant intensity was then applied to the glabrous surface of the paw through the glass plate and the latency to paw withdrawal measured. Paw withdrawal latency is reported as the mean of three measurements for both hind paws with at least a 5 min pause between measurements. A cut-off of 20 s was applied to avoid tissue damage.

Data Analysis
Data are presented as mean ± standard error of the mean (SEM) for cellular experiments or mean ± standard deviation (SD) for in vivo experiments. Statistical tests used to assess differences between groups are detailed in individual figure legends.

Data Analysis
All data are reported as mean values ± s.e.m. Behavioral assays were replicated several times (3 to 10 times depending on the experiments) and averaged per animal. Statistics were then performed over the mean of animals. Statistical analysis was performed in GraphPad Prism (USA) using two-sided paired or unpaired Student's ttests, one-or two-way repeated-measures ANOVA for functional assessments, when data were distributed normally. Post hoc Tukey's or Bonferroni test was applied when appropriate. The significance level was set as p < 0.05. The nonparametric Mann-Whitney or Wilcoxon signedrank tests were used in comparisons of <5 rats or mice. The camera was placed at a ~45° angle at ~1-2 feet away from the Plexiglas holding chambers on a tripod with geared head for Photron AX 50.

High-speed imaging and video storage
CMVision IP65 infrared lights that mice cannot detect were used to adequately illuminate the paw for subsequent tracking in ProAnalyst. All data were collected on a Dell laptop computer with Photron FastCAM Analysis software (average size of video file = ~2 GB).

Somatosensory behavior assays
In all behavioral experiments, we used a sample size of 6-10 mice per strain, as these numbers are consistent with studies of this kind in the literature to reach statistically significant conclusions. All mice were habituated for 2 days, for one hour each day, in the Plexiglas holding chambers before testing commenced. Mice were tested in groups of five and chambers were placed in a row with barriers preventing mice from seeing each other.
On testing day, mice were habituated for an additional ~10 min before stimulation and tested one at a time. Stimuli were applied through the mesh to the hind paw proximal to the camera.
Testing only occurred when the camera's view of the paw was unobstructed. Mice received two stimuli on a given testing day (db and lp) and were given at least 24 hr between each stimulus session.
Stimuli were tested from least painful to most: dynamic brush then light pinprick. Dynamic brush tests were performed by wiping a concealer makeup brush (L'Oréal Paris Infallible Concealer Brush, item model number 3760228170158) across the hind paw from back to front. Light pinprick tests were performed by touching a pin (Austerlitz Insect Pins) to the hind paw of the mouse. The pin was withdrawn as soon as contact was observed.

Proanalyst
We used ProAnalyst software to automatically track hind paw movements following stimulus application. This software allowed us to integrate automated and manually scored data, possible through the 'interpolation' feature within ProAnalyst. We were able to define specific regions of interest (paw), track, and generate data containing 'x' and 'y' coordinates of the paw through time. In a subset of videos, additional manual annotation was performed for increased accuracy.

DeepLabCut
For deep learning-based paw tracking in DeepLabCut (DLC), we pseudo-randomly selected a subset of training frames from trials which contained the greatest behavioral variation and hand-labeled the hind paw toes, center, and heel.
We trained DLC to predict toe, center, and heel positions in unlabeled video frames.

PAWS
Behavioral features were extracted from raw paw position time series in an automated and standardized procedure. First, the start and end of paw movement (paw at rest on the ground) were identified, and analysis was restricted to this time window. Peaks in paw height were then determined based on Savitsky-Golay smoothed estimates of paw velocity, and the first peak identified. The time of the first peak (designated t*) was used to separate pre-peak behavioral feature calculations from post-peak calculations. To differentiate shaking from guarding in the post-peak period, we