Social Exclusion Amplifies Behavioral Responses to Physical Pain via Insular Neuromodulation
University of California San Diego, La Jolla, CA 92093, USA
Salk Institute for Biological Studies, La Jolla, CA 92037, USA
Peking University School of Life Sciences, Beijing 100871, China
Howard Hughes Medical Institute, Salk Institute for Biological Studies, La Jolla, CA, USA
Kavli Institute for the Brain and Mind, La Jolla, CA, USA
†To Whom Correspondence Should be Addressed: Kay M. Tye, Ph.D. HHMI Investigator, Wylie Vale Professor, Salk Institute for Biological Studies, 10010 North Torrey Pines Rd., La Jolla, CA 92037, USA, tye@salk.edu, @kaymtyeAbstract
The “Pain Overlap Theory” (1) proposes that the experience of social pain overlaps with and amplifies the experience of physical pain by sharing parts of the same underlying processing systems (2–6). In humans, the insular cortex has been implicated in this overlap of physical and social pain, but a mechanistic link has not been made (2,4,5,7–9). To determine whether social pain can subsequently impact responses to nociceptive stimuli via convergent electrical signals (spikes) or convergent chemical signals (neuromodulators), we designed a novel Social Exclusion paradigm termed the Fear of Missing Out (FOMO) Task which facilitates a mechanistic investigation in mice. We found that socially-excluded mice display more severe responses to physical pain, disrupted valence encoding, and impaired neural representations of nociceptive stimuli. We performed a systematic biosensor panel and found that endocannabinoid and oxytocin signaling in the insular cortex have opposing responses during trials where mice were attending or not attending to the Social Exclusion events respectively, demonstrating distinct neuromodulatory substrates that underpin different states of Social Exclusion. We also found that intra-insular blockade of oxytocin signaling increased the response to physical pain following Social Exclusion. Together these findings suggest Social Exclusion effectively alters physical pain perception using neuromodulatory signaling in the insular cortex.
Article notes
Competing Interest Statement
The authors have declared no competing interest.
MAIN TEXT
Evolutionarily, social bonds endow survival advantages, facilitating access to food resources, protection from predators, and higher rates of mating (10–14). To maintain these bonds, it has been suggested that as sociality emerged throughout evolution, social species repurposed neural systems initially designed to prevent physical harm to additionally safeguard against social separation by eliciting social pain (8,15).
Social pain, the emotional pain caused by aversive experiences with other individuals (1,16–18), is an umbrella term that includes experiences such as social isolation, social exclusion, social rejection, and social loss and can act as a signal that triggers a need state to help maintain social homeostasis (16,19–23). Social pain is a unique aversive experience, which is typically prolonged and multidimensional (5), and acts as an internal state that can modify future responses to environmental stimuli (24–30).
Multiple theories have proposed that the experience of social pain can modulate both emotional valence (31) and physical pain (1,2). Using fMRI studies, social and physical pain overlap has been implicated in multiple brain regions associated with physical pain, including the anterior insular cortex (aIC) (8). However, there are many possible mechanisms that could underlie an increase in Blood-Oxygen Level Dependent (BOLD) signal, and these possibilities include increased blood flow in the absence of changes in neural activity, or as an indication of neural dynamics. This led us to ask, how is social pain represented within the brain and how can its perception modulate physical pain?
There are multiple animal models that exist to generate an aversive social experience, including social rejection, social isolation, and social defeat stress (32–35). To establish a paradigm that would allow us to investigate specifically social exclusion, which would simultaneously also avoid physical injury and have a repeatable trial structure, we developed a novel Social Exclusion paradigm which we termed the Fear of Missing Out (FOMO) Task. During the FOMO Task, standard physical pain assays, and a valence discrimination task, we performed cellular-resolution microendoscopic calcium imaging, collected biosensor-mediated endogenous neuropeptidergic dynamics, and applied intra-insular pharmacology to understand how social pain can have a sustained influence on physical pain responses.
“Attending” behavior is robustly discoverable with multiple clustering methods
After validating that our novel Social Exclusion paradigm effectively modulates physical pain, we wanted to identify explicit behaviors performed during the paradigm that could help quantify the subjective experience of the excluded mouse. Previous work in the physical pain field has migrated to considering higher-order behavioral sequences to predict pain states (41), and we wondered if we could expand these efforts to dissect social distress (42).
To do so, we first extracted the subject’s behavioral outputs using pose-estimation software SLEAP (43) (Fig. 1c and Extended Data Fig. 2a). Next, we calculated various continuous and discrete behavioral features of the subject mouse, a subset of which included the distance and angle to the chocolate milkshake port, body velocity, acceleration, turning angle, and cage zone of the subject mouse (Extended Data Fig. 2b). We then leveraged dimensionality reduction and clustering methods to identify behaviorally relevant states from these high dimensional behavioral features using Uniform Manifold Approximation and Projection (UMAP) and clustered using Density-Based Spatial Clustering of Application with Noise (DBSCAN) (44) (Fig. 1c). Using this approach, we manually assigned clusters into two main subsets of behaviors, which we classified into either “Attending” or “Not Attending” behavioral clusters (Extended Data Fig. 2c). A behavioral cluster was labeled as “Attending” when the subject mouse was oriented towards, rearing, or climbing the switchable glass divider separating the subject from the reward delivery port and any other mice. All other behaviors were classified as “Not Attending”. Given that these labels were manually selected by human experimenters, we wanted to then use an unbiased approach with both supervised and unsupervised methods.
To validate the existence and relevance of these “Attending” behaviors, we developed a new supervised machine learning algorithm (AlphaClass) to determine if we could identify these behaviors across the entire session (Fig. 1d,e). AlphaClass is a behavioral segmentation method that classifies whether behaviors are occurring directly from single images using a convolutional neural network (CNN) (Extended Data Fig. 3). After training the network, we used AlphaClass to predict the presence of “Attending” behaviors on all frames in our behavioral videos. Using this method, we discovered that during each trial onset, there is a significant increase in “Attending” frames during Social Exclusion, compared to the OM and TO conditions (Fig. 1f,g). We found that if we mapped the frames that were classified as “Attending” back onto the UMAP-generated behavior embedding, AlphaClass successfully targets a subset of “Attending” clusters identified with DBSCAN (Fig. 1h). SE mice that exhibit more “Attending” behaviors also have subsequent enhanced nocifensive behavior (reduced latency to jump) on the hot plate (Extended Data Fig. 4b), as well as licks after formalin injection (Extended Data Fig. 4f) suggesting that not only can these “Attending” behaviors be used as a marker for social effort to reunite with the social group, but also these “Attending” behaviors correlate with multiple modalities of physical pain.
A disadvantage of these UMAP-DBSCAN and AlphaClass methods to identify “Attending” behaviors is that both methods assume static structure of data without incorporating the history of past behaviors, and we wanted to compare this to methods that were designed for kinematic sequences. Thus, to leverage the temporal component of our data, we also used an alternative unsupervised method merging Keypoint-Moseq (KPMS) (45) and a hidden Markov model (HMM) (25) to identify discrete, but prolonged behavioral states in an unbiased fashion. Within our dataset, KPMS identified 87 syllables (Extended Data Fig. 5b), which we merged with our behavioral features to obtain distinct prolonged behavioral states: Passively Orienting, Rearing, Avoiding, and Attending (Fig. 1i). We found that SE mice spend significantly more time and have a higher dwell time within State 4: “Attending” (Fig. 1j,k). When we map these specific four states back onto the UMAP template, we saw that they overlap with those defined as “Attending” by AlphaClass and DBSCAN (Fig. 1l and Extended Data Fig. 5a). This demonstrates that regardless of the clustering or machine learning algorithm, we can robustly discover an “Attending” social effort state that is elevated during Social Exclusion in methods-agnostic manner.
Blockage of Oxytocinergic (OXT) signaling enhances physical pain responses after Social Exclusion
Given the analgesic properties of oxytocin and endocannabinoids (46,96,108), we speculated that the blockade of oxytocinergic signaling could promote active coping in response to painful stimuli, including “Attending” behavior in the FOMO Task or licking on the hot plate. Previously, it has been shown that direct injection of oxytocin into the aIC has anti-nociceptive effects (46). To first test the causal role of oxytocin or endocannabinoids, we injected an oxytocin receptor antagonist (OXTRA) L-368,899 or cannabinoid receptor 1 agonist (CB1RA) WIN55,212-2 into the aIC and exposed mice to Social Exclusion followed by the hot plate (Fig. 4a). To better visualize the specific granular behaviors modified by these pharmacological agents, we mapped behavioral responses back onto the same UMAP in Figure 1 to reveal the detailed behavioral profiles produced by CB1 receptor agonism and OXT receptor antagonism relative to their respective vehicle controls (Fig. 4b-d). Here, we focus on behaviors related to Attending to the other side of the chamber, but this detailed quantitative readout can be used to inform future research on other aspects of behavior.
Then we used AlphaClass to quantify the total “Attending” behavior during Social Exclusion and found that neither of the manipulations changed total “Attending” behavior during Social Exclusion (Fig. 4e,g). However, we did find that OXTRA mice exhibit an increase in affective nocifensive behaviors during hot plate (licking; Fig. 4h), providing evidence that OXT is protective against increased affective physical pain behaviors following Social Exclusion.
Collectively, our work provides the framework for a novel paradigm to induce Social Exclusion and the first evidence for a specific neural mechanism for the overlap between Social Exclusion and physical pain. Our findings support the “Pain Overlap Theory” and suggest that the oxytocinergic system is a key mediator of Social Exclusion within the aIC, which can successfully act as a bridge between different types of aversive experiences by modulating negative affect. Furthermore, this advances our general understanding of neural strategies that are employed within emotional pain processing systems within the brain and paves the way for targeted interventions aimed at alleviating the distress associated with social disconnection and pain dysregulation.
Acknowledgements
This work was supported by the Machine Shop of the Salk Institute and Bryan Nielsen. This preprint used the zHenriquesLab template for Overleaf and diagrams from Biorender. Funding: Salk Institute for Biological Sciences (KMT) HHMI (KMT) Kavli Foundation (KMT) Clayton Foundation (KMT) Dolby Family Fund (KMT) NIMH R01-MH115920 (KMT) NIMH R37-MH102441 (KMT) NICCIH Pioneer Award DP1-AT009925 (KMT) Salk Women in Science (CJ) NIMH 1RF1MH132653-01 (TDP) NIDA R00DA055111 (HL) Author Contributions: Conceptualization: CJ, KMT Stereotaxic Surgeries: CJ, AT Behavioral Experiments: CJ, AT, FA, NT, ES, NNN Fiber Photometry and Calcium Imaging Experiments: CJ, AT, FA, AN SLEAP automated pose tracking analysis: CJ, MGC, AT, FA, NT, ES, NNN Keypoint-Moseq Analysis: CJ, ES Histological Verification: CJ, AT, FA, ES, NT Code Scripts: CRL, RRP, KB, JD, LRK Intellectual contributions: FT, KB, RW, MKB, TDP, HL AlphaClass architecture: AB Data analysis: CJ, AT, ES, NT, FA, AN Data preparation and sharing: CJ, AT, RW, LRK Materials: YL Writing – original draft: CJ, KMT Writing – review and editing: all authors contributed to editing the manuscript
Competing Interests
The authors declare no competing interests.
Data and Materials Availability
All experimental data are available in the main text or supplementary material. Raw neural recordings and simultaneously recorded behavioral outputs are available on DANDI. AlphaClass package is available on the Tyelab GitHub.
Supplementary Materials
Materials and Methods
Figs. S1 to S10
Videos S1 to S2
MATERIAL AND METHODS
Animals and housing
Adult, male C57/BL6J mice (8-12 weeks) from Jackson Laboratory were used for all experiments described. Mice were housed 4 mice/cage on a 12-h reverse light/dark cycle with ad libitum access to food and water unless otherwise specified. All experiments were conducted during the dark cycle phase and performed either in low white light or red light. All experimental procedures were carried out in accordance with NIH guidelines and approval of the Salk Institutional Animal Care and Use Committee.
Stereotaxic surgeries
All surgeries were conducted under aseptic conditions. Briefly, mice were anesthetized with an isoflurane/oxygen mixture (4-5% for induction, 1-2% for maintenance) and placed in a stereotaxic head frame (David Kopf Instruments, Tujunga, CA, USA). A heating pad was placed under the mice to maintain body temperature, and Sterile Lubricant Eye Ointment (Stye INSIGHT Pharmaceuticals Corp. Langhorne, PA) was applied to the eyes to prevent drying. The incision area was shaved, and the skin was cleaned with alternating washes of 70% alcohol and betadine. A subcutaneous injection of lidocaine (0.5%) was placed at the incision site for 3-5 minutes prior to surgery. An incision was made along the midline to expose the skull, and a dental drill was used to perform a craniotomy. During all surgeries, animals were injected subcutaneously with 1 mL of Ringer’s solution, Buprenorphine (1 mg/kg), and Meloxicam (5 mg/kg). For recovery animals, were placed in a clean cage on a heating pad. Animals were given >28 days for recovery before starting behavioral paradigms.
All stereotaxic coordinates were measured relative to bregma and the top of the skull. Injections of viral vectors were performed using glass pipettes (Drummond Scientific) pulled to a 100-200 µm tip diameter with a pipette puller (Narishige PC-10, Amityville, NY, USA). Pipettes were either attached to 10 µl microsyringes (Hamilton Microlitre 701, Hamilton Co., Reno, NV, USA) with a microsyringe pump (UNP3; WPI, Worcester, MA, USA) and digital controller (Micro4; WPI, Worcester, MA, USA), or to the Nanoject III Programmable Nanoliter Injector (Drummond Scientific, Broomall, PA, USA) with digital controller (Drummond Scientific, Broomall, PA, USA). For each injection, micropipettes were slowly lowered to the target site and viral vectors were delivered at a rate of 1.0 nL per second. After the injection was completed, micropipettes were raised to 0.1 mm above the injection site and held for 10 minutes. After 10 mins, the pipette was slowly withdrawn, and the skin incision was closed with nylon sutures.
To perform calcium imaging recordings, mice underwent surgery as described previously. For non-specific aIC recordings, 200 nl of AAV1 -Syn-jGCaMP7f-WPRE (Addgene), encoding GCaMP7f, was injected into the aIC (AP: +1.9 mm, ML: +2.85 mm, DV: −3.4 mm) and a 0.6 mm diameter by 7.3 mm length gradient refractive index lens with integrated baseplate (GRIN lens, Inscopix) was slowly lowered above the aIC (AP: +1.9 mm, ML: +2.85, DV: −3.15 mm). No tissue was aspirated. All lens implants were secured to the skull with a thin layer of adhesive cement (C&B Metabond, Parkell), followed by black cranioplastic cement (Ortho-Jet, Lang). The implant was allowed to completely dry before closure of the incision with nylon sutures.
To record oxytocinergic, dopaminergic and endocannabinoid dynamics within the aIC, mice underwent surgery as described previously. An AAV9 carrying either the dopamine, oxytocin, or endocannabinoid fluorescent sensor (AAV9 -hSyn-GRABDA3h, AAV9 -hSyn-GRABOT1.0, AAV9 -hSyn-GRABeCB2.0) was injected (AP: +1.9 mm, ML: +2.85 mm, DV: −3.4 mm) and a 400 µm diameter optical fiber was implanted into the aIC. All fiber implants were secured to the skull with a thin layer of adhesive cement followed by black cranioplastic cement. The implant was allowed to completely dry before closure of the incision with nylon sutures. Behavioral experiments were conducted 4-7 weeks after surgery.
To perform intracranial pharmacology within the aIC, mice underwent surgery as described previously. Bilateral cannulas (Protech Technologies) were implanted 1 mm above the aIC (AP: +1.9 mm, ML: +2.85 mm, DV: −2.4 mm). The incision was closed with nylon sutures. Behavioral experiments were conducted 2-3 weeks after surgery. During experiments, an internal cannula with 1 mm projection was used to deliver drug into the brain.
Behavioral assays
Prior to behavioral testing, mice were habituated for one week to all experimenters to reduce stress during experiments.
Food Restriction
Subjects were fed ad libitum until initiation of experiments requiring food restriction (reward conditioning and FOMO tasks). Prior to these experiments, subjects were weighed to the nearest gram to attain a baseline for free-feeding body weight. During experiments requiring restriction, subjects were weighed daily and food-restricted to a limit of 85% of this baseline weight. Restriction was attained through limiting daily access to food pellets, providing approximately 2.0g/animal per day. Animals had free access to water throughout.
Reward conditioning
Food-restricted mice were conditioned in sound-proof boxes (MedAssociates, St Albans, VT) for five days. Each box contained a modular test cage assembled with a 3D-printed reward port, a speaker, a red LED indicator light, and 2 house lights. The first trial began after a 245s habituation period. The CS consisted of a pure 3.5kHz tone cue, which ended 400ms after a port entry infrared beam break by the mouse was detected. One second after CS onset, 5 µl of chocolate milkshake, Ensure™, was delivered. The first chocolate milkshake delivery was given freely but subsequent chocolate milkshake deliveries only occurred if the mouse had entered the port after the CS onset. Inter-trial time intervals varied between 40-60s. Each conditioning session consisted of 120 trials. Mice were considered successfully trained if they reached a 70% probability of port entry during the CS.
Three days into reward conditioning, the mice were placed in the same sound-proof boxes (MedAssociates, St Albans, VT) with a switchable glass divider connected through an IoT relay. Each mouse was individually placed on the side of the wall opposite of the reward port. Each habituation session consisted of 60 trials, during which no tones or reward were delivered. The purpose of this session was to habituate mice to the sound of the switchable glass divider.
Hot Plate
To measure thermal sensitivity after the Social Exclusion, One Mouse, or Tone Only behavioral conditions, mice were placed inside a cylindrical, transparent Plexiglass chamber (Diameter = 11 cm, Height = 15 cm) on a hot plate (54°C, IITC Life Science) for 60s. The latency and duration of each behavioral response (hind paw shake, lick or jump) was manually recorded using Behavioral Observation Research Interactive Software (BORIS) scoring software (105). To ensure unbiased evaluations, the manual scoring on BORIS was done without the knowledge of the experimental conditions. Because individual mice have been known to have variable responses on hot plate depending non-nociceptive factors (weight, age, activity, habituation and repeated testing), we calculated baseline values for each mouse’s baseline pain response (106,107). Baseline values were determined for each mouse’s baseline pain responses, based on a baseline hot plate session. Normalized Lick Duration for hot plate was calculated Paradigm / Baseline. Difference Lick Score was calculated using Paradigm-Baseline.
Formalin Assay
To measure inflammatory responses after Social Exclusion, One Mouse, or Tone Only behavioral conditions, animals were injected in the right hindpaw with 1% formalin solution and placed in a rectangular, transparent Plexiglass chamber for 1 hour. The number of licks and duration of lick bouts was quantified using AlphaClass, which was trained on a model using 3700 frames.
Innocuous and Nociceptive Stimulus Application
To measure time locked responses to various mechanical and thermal stimuli, mice were habituated to a clear plexiglass container (Animal enclosure, IITC433) on top of a mesh stand (IITC 410). On test day, after running through one of the three social paradigms, mice were placed within the plexiglass enclosure, and five rounds of four stimuli (0.16g Von Frey (IITC), 2.0g Von Frey, Pinprick using a 25g needle, 55°C Water Droplet) were applied. Each stimulus was applied in an alternating fashion to each hindpaw with one minute intertrial intervals and the neural response during each stimulus application was recorded and analyzed.
Tube Dominance Test
The tube dominance test was used to assay the social rank of each mouse relative to their cagemates (108). Mice were individually trained to walk through a clear Plexiglass tube (30 cm length, 3.2 cm inner diameter) over ∼2days, until they were comfortably walking across without resistance. To test for rank, all mice in each cage were tested in a round robin design in a randomized order. For each pair, mice were released at opposite ends of the tube simultaneously, so that they met faceto-face in the center of the tube. The mouse that either backed out itself or was pushed out from the end where it was released was designated as “loser/subordinate” whereas the other mouse was designated as “winner/dominant.” Social ranks obtained with the tube test were considered stable when obtaining the same results for four or more days in a row. An animal’s “social rank” was measured by the proportion of “wins” across all contests from all days of testing.
Pharmacological manipulation
OXT Receptor Antagonist (L-368,899 hydrochloride, Tocris Cat. No. 2631) was dissolved in sterile phosphate buffered saline (PBS) (50 µg/µl), aliquoted, and then stored in −20 °C. Drug was freshly dissolved each day. Endocannabinoid Receptor Agonist (WIN55212-2, Cayman Chemical No. 10009023) was dissolved in a 1:1:1:17 mixture of Ethanol, DMSO, Kolliphor, PBS, and then stored in −20°C.
For both drugs, 10 minutes prior to the start of the behavioral assay 0.2 µl was infused bilaterally into the insular cortex via dual internal infusion needles connected to a 10 µl microsyringe. The flow rate was kept to 100 nl per min and was regulated by a syringe pump (Harvard Apparatus, MA). Infusion needles were withdrawn 2 minutes after the infusion was complete. Each mouse only received one injection and each condition (OXTRA/CB1RA or Vehicle) utilized separate cohorts.
Freely moving behavior, discrimination task
To test valence discrimination, mice underwent a Pavlovian discrimination assay. Associative reward training was performed as described above in reward conditioning. For shock acquisition, the mice were conditioned using behavioral hardware boxes (MedAssociates, St Albans, VT) placed in custom made sound attenuating chambers. Each box contained a modular test cage with an electric floor grid and a speaker. Videos of the mice were acquired during all sessions. A period of acclimation lasting four minutes preceded the presentation of the first tone. During shock conditioning, mice were presented with a 20kHz tone followed by a 0.1s long 0.7mA shock 9.8s later. Inter-trial intervals varied from 40-60s with an initial 10s delay before the first cue onset. Shock-tone association training consisted of 60 trials within one session.
One day after chocolate milkshake reward and shock conditioning, mice completed the Social Exclusion, One Mouse, or Tone Only social paradigm, and immediately underwent the two-cue Pavlovian discrimination task. During each trial, mice were presented with either a 3.5kHz tone (associated with chocolate milkshake reward) or a 20kHz tone (associated with shock) using the same trial structures as described above. Reward (56) and shock (34) trials were presented in pseudorandom order. Intertrial intervals were varied from 40-60s with an initial 4-minute delay for habituation preceding the first CS onset. An LED light was toggled on and off for the period of the tone and used to sync videos to trial start for data processing. Videos were recorded to monitor animal behavior during all sessions. Neural recordings using the Inscopix system described below were also obtained during each session. Each session consisted of 90 trials and the protocol was repeated for each of the Social Exclusion, One Mouse, and Tone Only social conditions for each mouse.
Freezing and dashing behavior were scored in Matlab by setting a threshold for velocity and acceleration for movement. Frames below this threshold were scored as freezing behavior.
SLEAP automated pose tracking analysis
To automatically detect mouse social interaction behavior, Social LEAP Estimates Animal Poses (SLEAP), version 1.3.0 (43), was used to estimate animal poses in behavioral videos. Behavioral videos were taken using a video camera (Arducam 1080P, 30 fps). A training data set was labeled using a 9-point skeleton on the mouse (nose, right ear, left ear, torso, left forepaw, right forepaw, left hindpaw, right hindpaw, and tail base). All annotators were instructed to annotate the ears within the middle of each ear, the nose at the tip of the mouse nose, and the tail base where the tail began. Any body parts that were not clearly visible were empirically estimated to their most likely location given the mouse’s position. This data set was used to train a top-down model with 2955 frames, with −180° to 180° augmentation because videos were taken from above. All frames were visually confirmed for correct tracking of identity and manually corrected into a consistent track for the excluded animal.
Keypoint Moseq (KPMS)
To perform unsupervised classification of mouse behaviors during the Social Exclusion, One Mouse, and Tone Only social paradigms using keypoint-MoSeq (45) (KPMS), which is built from an auto-regressive hidden Markov model (AR-HMM). The output of SLEAP, raw “keypoint” data for each frame, was used as training data for KPMS. The initial AR-HMM model was run through 200 iterations on a sample of 20 collected videos using a kappa value of 10e12. The full model was then run using a kappa value of 10e9 for 500 iterations. The final KPMS output was 87 “syllables” representing behavioral motifs in the data.
Together, the KPMS syllables were combined with seven other features: five continuous features: (distance of nose to port, angle of nose to port, body velocity, turning angle) and two discrete features (zone, oriented to port). KPMS syllables and seven features were run through a second HMM (adapted code from Vidaurre et al., 2017 (109)) to further consolidate the syllables into hidden states. To determine the optimal number of hidden states, the log-likelihood using 2-12 states was calculated and determined to be 4 states.
AlphaClass
Generation of Algorithm: AlphaClass is a supervised behavior segmentation method that employs a similar approach to pose estimation methods to instead detect localized instances of behaviors within an image. Contrary to other existing methods for behavior segmentation that operate on keypoint timeseries (SimBA (110), Keypoint-MoSeq (45)), AlphaClass predicts the likelihood of the presence of behaviors directly from images, similar to DeepEthogram (111). Unlike DeepEthogram, however, AlphaClass operates on single images and predicts the location of where the behavior is occurring by regressing a heatmap, as employed by pose estimation methods for keypoint localization.
Users first begin by defining areas of behavior by placing a point (circle) at the location of a particular behavior, such as placing a point on a grooming mouse, or placing a point at the joint between a mouse’s tail and another mouse’s nose to label chasing behaviors. This is done using makesense.ai. Multiple behaviors can be labeled at a time, such as labeling two mice in a scene that are fighting, while simultaneously labeling a third mouse that is rearing. AlphaClass receives this training data and performs feature detection and keypoint estimation to estimate the likely location of those same user-defined behaviors in untrained frames of video. First, AlphaClass receives an image as an input, such as a single frame from a video of behaving mice. Next, AlphaClass extracts features from these single frames using convolutional neural networks (CNN). The network uses a Resnet50 backbone followed by three upsampling layers, which creates a sigmoid output. This sigmoid output is an input for non-maximum suppression, which is used to identify local peaks and filter our ambiguous detections. The existence of the peaks is interpreted as a positive prediction that the behavior is occurring within the frame whose confidence is the value of the identified peak.
This approach enhances the interpretability of behavior segmentation predictions by providing an estimate of the location where a behavior is occurring, in addition to the confidence. As this bypasses the need for pose estimation, AlphaClass provides a more direct method to detect behaviors that are difficult to classify from pose tracking, such as close social interactions where poses are often noisy due to occlusion. Since AlphaClass only operates on single images, it is limited to classes of behaviors where static image features (e.g., body shape, relative locations) are sufficient to discern whether the behavior is occurring.
Data Analysis: AlphaClass was adapted to quantify the number of “Attending” frames during the Social Exclusion, One Mouse, and Tone Only paradigms, as well as the number of “licking” frames during the formalin assay. Sample frames of the desired behaviors were curated from multiple videos and these frames were labeled using an object detection program, makesense.ai. These frames were then used as training data for AlphaClass and all videos were run through the completed model. A final h5 file was produced for each video and analyzed using MATLAB scripts.
The total number of “Attending” frames was normalized to the baseline number of “Attending” frames present for 5 seconds preceding the onset of the trial. Each 5s interval following trial onset was separately normalized to baseline and total “Attending” frames were calculated by summing the total “Attending” frames over the three time bins from 0-15s.
To characterize the identity of each of the 60 trials and classify them as “Attending” trials or “Not Attending” trials, we applied a global and local threshold analysis using the median value. For the global analysis, the number of “Attending” frames across 60 trials was consolidated across all animals and all paradigms, and the median value of these responses was set as the global threshold. To calculate the local threshold, the number of “Attending” frames across 60 trials was consolidated across each animal for all three paradigms and the median value of these responses was set as the local threshold. Trials that contained more “Attending” frames than this global or local threshold were classified as “Attending” trials, and the rest were classified as “Not Attending” trials. For neural analysis, the local threshold was used per mouse, and the top 15 trials with the most “Attending” frames and bottom 15 trials with the least “Attending” frames were selected to align neural activity to.
Fiber Photometry
Data acquisition. For fiber photometry experiments, the Neurophotometrics system was used (Neurophotometrics LLC), where a 415 nm LED was used for the reference channel. Frames were captured at 40Hz and each LED was modulated at 20 Hz in an alternating fashion, resulting in a 20Hz sample rate in the reference and signal channels. LED and camera timing as well as recording of timestamps from behavioral equipment was achieved using a data acquisition board (National Instruments NI BNC-2110). Prior to the start of each session, the entire system was shielded from outside light using blackout cloth. Patch cords were obtained from Thor Labs and were photobleached for 24 hours prior to the start of recordings. LED power was calibrated to emit 470 nm light at 50µW for GCaMP activation and 405 nm light at 50µW (measured at the end of the patch cable) through each ferrule, which then interfaced with a ferrule implanted in the mouse (carrying fibers of efficiencies between 80-95%). LEDs were turned on and data was collected continuously for the entire session. Each trial and cue onset were marked through a TTL pulse sent to the Neurophotometrics system.
Data analysis. Both the calcium signal (responses to 470 nm excitation) and reference signals (responses to 405 or 415 nm excitation) were filtered to reject high frequency noise using a forward only median filter with a span of 200ms. Data from the reference channel was then regressed from data in the 470 nm channel. Regression coefficients were computed using data averaged across trials in a session in a time window of −1s to 0s from the start of the CS to minimize any possible regression artifacts introduced by calcium transients recorded in the 470 nm channel evoked by the sensory stimuli or the animal’s response. Residuals from the regression were z-transformed using data from a baseline window of −1s to 0s relative to the start of the CS.
Cellular Resolution Calcium imaging
Data acquisition: for both Calcium imaging data acquisition and calcium signal extraction nVoke Inscopix systems were used to collect calcium imaging data. During behavior, a TTL signal was used to trigger the miniscope recording to begin. The miniscope was connected to an active commutator (Inscopix). Image processing was accomplished using IDEAS software (Inscopix).
Data analysis: Raw videos were pre-processed by applying 4x spatial downsampling to reduce file size and processing time. A temporal downsampling was applied for a final frame rate of 10Hz. Images were cropped to remove post-registration borders and sections in which cells were not observed. Motion was corrected for by using the first frame as a reference frame. Videos were then exported as TIFF stacks for analysis and converted to an 8-bit TIF file in Fiji ImageJ.
TIFF stacks were then loaded into MATLAB, and additional non-rigid motion correlation was performed using the NoRMCorre package (112). We then used the constrained non-negative matrix factorization algorithm optimized for micro-endoscopic imaging (CNMF-E) (113) to extract fluorescence traces from neurons. Since cellular calcium fluctuations can exhibit negative transients associated with decreases in firing, we did not apply non-negative constraints on temporal components. All neurons were visually confirmed, and neurons exhibiting abnormalities in morphology and calcium traces were excluded. Neuron curation was performed by experimenters blinded to the experimental condition.
To calculate the neuronal response to social and physical pain, the GCaMP7f fluorescence signal for each neuron was z-score normalized to a 1s baseline period immediately preceding the onset of the trial. Trial onset was recorded using the Inscopix system with a single TTL pulse that marked each trial. Z-scores were calculated as (F(t)-Fm)/SD where F(t) is the F/F0 at time t and Fm is the mean of F/F0 in a baseline period. The z-scored normalized trace was then averaged across a matched number of social trials (“Attending”/”Not Attending”), discrimination trials (reward/shock), and pain trials (0.16gVF, 2.0gVF, pinprick, hot water) for each condition for each neuron. The population mean response was then calculated by averaging the mean z-scored normalized trace of all neurons. The proportion of responsive neurons was calculated using the Wilcoxon signed-rank test.
To co-register neurons between social and physical sessions, we used the cell registration algorithm through an open sourced MATLAB based GUI, CellReg (114). Briefly, spatial footprints of neurons, from CNMF-E output, for all sessions were aligned to a reference session through rotational and translational shifts. Cell pairs were identified by employing a Bayesian probability method that considers the centroid distance between cells and their spatial correlation.
Decoding
To test if trial types (reward/shock), (“Attending”/”Not Attending”), (dominant, intermediate, subordinate), (0.16gVF, 2.0gVF, pinprick, hot water), could be decoded from single trial aIC population activity, a generalized linear model (GLM) or a support vector machine (SVM) was used. All animals were pooled together to perform global principal component analysis (PCA) over all animals. PCA was only performed on averages of neural activity that would be used for the training set, while omitting the test set. To obtain single trial aIC population activity we used the coefficients obtained for each neuron in the global PCA and created a single trial neural trajectory using the calcium activity for that trial. We used the number of PCs required to explain 90% of the variance, and trained the GLM using these PCs as features, and the trial type as labels. In cases where there were more than two potential categories, as in rank or pain decoding, we used a one-vs-all strategy, where we convert the multi-class problem into four binary primaries (i.e., dominant vs others. intermediate vs others, light touch vs others). We did a 5-fold cross validation for all decoding analyses besides the rank decoding. For these datasets, the data were split into five parts, for 5-fold cross validation and in each iteration the training consisted of a different 80% subset of the data and the testing was done with the remaining 20% of the data. For the rank decoding, we used 10-fold cross validation because more trials were available. For conditions where there were an unequal number of trials, such as reward and shock, where the number of reward trials exceeded shock trials, we randomly subsampled the reward trials to match the number of shock trials for each iteration. We generated the binary classification output in a receiver operating characteristic (ROC) curve, as a function of time. To quantify results, we took the average of the ROC curve over a relevant window, depending on the analysis. For shuffled controls, we repeated the same process with the training data labels shuffled to see the performance of a chance model.
To test if trial type (“Attending” vs “Not Attending”) could be decoded from single trial aIC bulk fluorescence reflecting neuromodulator dynamics for all three of the biosensors used, a random forest (RF) classifier was used. All animals were pooled together and only animals that had successfully undergone all three conditions were included. We did 5-fold cross validation for all decoding, and the data was split into five parts and in each iteration, the training contained 80% of the data and the testing was done on the remaining 20%. All timepoints were pooled together over a relevant window and the ROC obtained using all these data was obtained. For shuffled controls, we repeated the same process using shuffled training data labels.
Trajectories
To visualize the neural population dynamics in a lower dimensional space, PCA was used to perform dimensionality reduction. A single global PCA was done on a matrix containing all the data for all groups such that neural trajectories could be compared across groups (SE/OM/TO). This matrix had neurons in rows, and in the columns had mean firing rates during −5 to 15s post task-relevant event. All neurons were co-registered across groups so the same neurons would be represented once and horizontally concatenated. The neural trajectories for each task-relevant event were created per group by multiplying the coefficients obtained in the PCA by the mean firing rates across trials.
For each trajectory, the geodesic length was calculated as the sum of Euclidean distances between adjacent 100 timepoints. Distance between trajectories was calculated as the Euclidean distance between the two trajectories bin-by-bin. To allow for statistical comparisons, the neural trajectory metrics were calculated using the leave one out (LOO) method, leaving out all the neurons from a single animal per group, thus the number of iterations is the number of mice in that group. The n reported in trajectory quantifications corresponds to the number of mice utilized for the LOO. Importantly, in every iteration the same PCA coefficients per cell were used for the neural trajectory, since the PCA was done prior to this step, but the neurons included varied. Distance between trajectories was calculated as the Euclidean distance between the two trajectories bin-by-bin. LOO was completed in the same process as for trajectory length calculations. For visualization purposes we plotted the first two or three PC subspaces, but for quantification of trajectory lengths and distance between trajectories the number of PCs that captured 90% of the variance was used. For just the PC space visualizations, we smoothed the trajectories using MATLAB’s smoothdata function.
Agglomerative hierarchical clustering
Prior to clustering, the data were preprocessed as follows: The peristimulus time histogram (PSTH) was computed using 5s baseline, 15s postcue. Z-scores were calculated using the mean and standard deviation during the baseline period (−1 second to cue onset) individually for each neuron. Data from each experiment protocol (“Attending”, “Not Attending”, and pinprick) were concatenated to calculate universal clusters, allowing for comparisons between each of the social conditions (SE/OM/TO). Using MATLAB, a hierarchical cluster tree was generated using Ward’s method, which uses inner squared distance to determine hierarchy using correlation for the distance metric. A cutoff threshold was used to determine clusters; the value selected was 30% of the maximum value of the linkage distance. Heatmaps plotted for each region are the smoothed z-score input data; clusters for each region are color-coded based on the original cluster tree. All neurons from each cluster were then averaged to create a peri-event time histogram of activity for each cluster during “Attending”, “Not Attending”, and pinprick trials associated with each of our three social sessions. To calculate cluster enrichment, for each social session (SE/TO/OM), the percentage of neurons in each cluster was calculated, and then plotted in comparison with other paradigms.
To determine if a cell was significantly responding to an event, we compared the firing rate in a baseline period vs the event onset (5s window for baseline and event) using a Wilcoxon sign rank test. If firing rate change was significant, excitation or inhibition was determined based on the average z-score during the 15s response window (if it was positive the cell was considered excited, while if it was negative the cell was considered inhibited). The number of responsive neurons was calculated and overlapping neurons responsive to both “Attending”/”Not Attending” and pinprick trials were calculated. Comparisons across different social conditions were done using the chi-squared test. Overlapping excited and inhibited neurons were averaged to plot a per-event time histogram for their responsiveness to pinprick to assess changes in amplitude.
Histology
Following experiments, mice were deeply anesthetized with sodium pentobarbital (200 mg/kg, intraperitoneal injection). Animals were transcardially perfused with 10 mL of Ringer’s solution followed by 10 mL of cold 4% PFA in 1X PBS. For viral injection, optic fiber, GRIN lens or cannula verification, mice were immediately decapitated after experiments and the whole head was submerged in 4% PFA in 1X PBS for 24 hours at 4°C. The following day the fiber optic implants/GRIN lens/cannulas were removed, and the brains were extracted. Brains were then transferred to 30% sucrose in 1X PBS at 4°C for 12 hours on a shaker. Brains were sectioned coronally at 50µm using a microtome (ThermoScientific) and sections were mounted directly onto glass microscope slides and cover slipped with EMS-Shield Mounting Medium w/ DAPI. Slides were then imaged at 4x magnification using a Keyence BZX710 Fluorescence microscope. Injection sites and implants relative to the mouse atlas were annotated.
Confocal microscopy
Confocal fluorescence images were acquired on an Olympus FV1000 confocal laser scanning microscope using a 20x/0.75NA objective or a 40x/1.30NA oil immersion objective. Serial Z-stack images were acquired using the FluoView software (Olympus, Center Valley, PA) to confirm viral injections and fiber placements. The tip of the fiber was determined by the 50µm thick gliosis generated by the fiber. The number of cells were quantified with the Imaris software (Bitplane Inc., South Windsor, CT). Regions were located and reported in accordance with the mouse brain atlas.
Statistics
Statistical analyses were performed using GraphPad Prism 8 (GraphPad Prism, La Jolla, CA) and MATLAB 2023b (Mathworks, Natick, MA). Data with a Gaussian distribution were compared using a paired or unpaired t-test (non-directional) for two experimental groups, and a One-Way or Two-Way ANOVA with repeated measures for three or more experimental groups. To assess responsive neurons, we used a one-sided Wilcoxon rank-sum test. Correlation between two variables was assessed using the Pearson’s correlation coefficient. Kolmogorov-Smirnov statistics were used to detect differences in distribution between two groups. Threshold for significance was placed at p < 0.05. All data are shown as mean ± standard error of the mean (s.e.m).
Sample size
Sample sizes were based on similar studies in the literature. Sample size is reported in the legends and methods.
Data exclusions
For calcium experiments, animals were excluded based on histological verification criteria. Histological verification was done by an experimenter blind to the experimental manipulation. Included experimental animals successfully completed 60 trials of SE, OM, and TO, as well as non-nociceptive and nociceptive stimulus application afterwards. Out of eight animals, one animal was excluded based on the histological criteria, and another based on incomplete experimental data collection in Figure 2 and 3. For the Pavlovian discrimination task, one mouse was excluded for learning how to effectively escape from the shock. In photometry experiments, mice were excluded based on histological verification criteria. One animal was excluded for OXT sensor analysis based on lack of expression. One animal was excluded out of OXT sensor OM group analysis based on Grubbs’ test for outliers. For eCB sensor experiments, three animals were excluded for light leak, and seven for lack of expression.
Reproducibility
Randomization
For behavioral experiments, mice in each cage were randomly divided into SE, OM, and TO groups. Four mice were present in each cage, and each cage had at least one mouse undergoing SE, OM, or TO. The total number of mice undergoing each behavioral paradigm was counter-balanced across mice. For imaging experiments, mice in each cage were randomly divided between experimental and control groups, with two experimental and two control mice in a cage of 4.
Blinding
During behavioral testing investigators were not always blind to the group affiliation (experimental vs control) given familiarity with the subjects. However, for histology, calcium imaging and biosensor experiments, the experimenters were blinded to the group assignment of the animals (experimental vs control). During data processing and analysis experimenters were blinded to the group affiliation until the point that all data was processed such that group comparisons could be made.
Data availability
All mouse illustrations included in the main figures were created with BioRender.com. Source data needed to recreate the primary statistical results shown in Figures and Supplementary Figures have been provided as a Supplementary Source Data File. Raw and processed calcium recordings are available on DANDI, and where available we will also include simultaneously recorded behavior videos.
Code availability
AlphaClass used to process data shown in this manuscript is available on the Tyelab GitHub (https://github.com/Tyelab/AlphaClass).