Prediction of Choice from Competing Mechanosensory and Choice-Memory Cues during Active Tactile Decision Making

Perceptual decision making is an active process where animals move their sense organs to extract task-relevant information. To investigate how the brain translates sensory input into decisions during active sensation, we developed a mouse active touch task where the mechanosensory input can be precisely measured and that challenges animals to use multiple mechanosensory cues. Male mice were trained to localize a pole using a single whisker and to report their decision by selecting one of three choices. Using high-speed imaging and machine vision, we estimated whisker–object mechanical forces at millisecond resolution. Mice solved the task by a sensory-motor strategy where both the strength and direction of whisker bending were informative cues to pole location. We found competing influences of immediate sensory input and choice memory on mouse choice. On correct trials, choice could be predicted from the direction and strength of whisker bending, but not from previous choice. In contrast, on error trials, choice could be predicted from previous choice but not from whisker bending. This study shows that animal choices during active tactile decision making can be predicted from mechanosensory and choice-memory signals, and provides a new task well suited for the future study of the neural basis of active perceptual decisions. SIGNIFICANCE STATEMENT Due to the difficulty of measuring the sensory input to moving sense organs, active perceptual decision making remains poorly understood. The whisker system provides a way forward since it is now possible to measure the mechanical forces due to whisker–object contact during behavior. Here we train mice in a novel behavioral task that challenges them to use rich mechanosensory cues but can be performed using one whisker and enables task-relevant mechanical forces to be precisely estimated. This approach enables rigorous study of how sensory cues translate into action during active, perceptual decision making. Our findings provide new insight into active touch and how sensory/internal signals interact to determine behavioral choices.


Introduction
Perceptual decision making (Romo and Salinas, 2003;Cohen and Newsome, 2004;Gold and Shadlen, 2007;Carandini and Churchland, 2013;Diamond and Arabzadeh, 2013;Svoboda and Li, 2018) is an active process where movement of the sense organs-for example, eyes, ears, nose, fingers, or whiskers-is crucial to extract task-relevant information (Gibson, 1962;Yarbus, 1967;Youngentob et al., 1987;Jordan et al., 2018). Our understanding of how the brain translates sensory signals into decisions during active sensation has been held back by the experimental difficulty of measuring sensory input to a moving sense organ. However, new approaches developed for the mouse whisker system provide a way forward (O'Connor et al., 2010bHires et al., 2015;Peron et al., 2015a;Yu et al., 2016). Here, we describe a new tactile task for mice that permits precise monitoring of sensory input during active, perceptual decision making, and thereby identifies specific mechanosensory and choice-memory signals that predict the animals' choices.
Recently, high-speed imaging and machine vision methods that make it possible to measure whisker-object forces in behaving animals were developed (Birdwell et al., 2007;O'Connor et al., 2010a;Clack et al., 2012;Pammer et al., 2013; for review, see Campagner et al., 2017). A head-fixed mouse paradigm, where animals are trained to localize a vertical pole with their whiskers, is advantageous. Head-fixation permits whisker movement and whisker shape to be imaged at high spatiotemporal resolution. The curvature of a whisker bending against a vertical pole can be measured, allowing whisker-object contacts, and associated mechanical forces, to be precisely estimated. Previous studies have used two-choice tasks where animals are trained to report anterior-posterior or medial-lateral pole locations by licking (O'Connor et al., 2010a;Pammer et al., 2013;Guo et al., 2014b). Mice solve the anterior-posterior task by learning to focus their whisking on one of the pole locations. In this way, the strength and number of touches allows mice to discriminate pole location (O'Connor et al., 2010a(O'Connor et al., , 2010b. However, it remains unclear how rodents solve active touch tasks under conditions when these elementary cues are insufficient. Here, we developed a novel, three-choice pole localization task, where the mechanosensory input guiding decision making can be precisely measured and that challenges mice to use cues beyond the strength and number of touches. We identified key mechanosensory cues and discovered that these cues, in conjunction with an internal signal (memory of choices on previous trials) allowed mouse choices to be accurately predicted.

Materials and Methods
All experimental protocols described in this section were approved by both United Kingdom Home Office national authorities and institutional ethical review.

Surgical procedure and water restriction
Mice (C57; males; N ϭ 5; 6 weeks at time of implant) were implanted with a titanium head-bar as detailed by Campagner et al. (2016). After surgery, mice were left to recover for at least 5 d before starting water restriction (1.5 ml water/d). Training began 7-10 d after the start of water restriction.

Behavioral apparatus
Mice were trained in a dark, sound-proofed enclosure adapted from O'Connor et al. (2010a) and Campagner et al. (2016). Briefly, a headfixed mouse was placed inside a Perspex tube, from which its head emerged at one end. The stimulus object was a 1.59-mm-diameter, vertical metal pole that could be translated parallel to the anterior-posterior axis of the mouse by a linear stepper motor (NA08B30, Zaber). To allow vertical movement of the pole into and out of range of the whiskers, the pole was mounted on a pneumatic linear slide (SLS-10 -30-P-A, Festo) powered by compressed air. The apparatus was controlled from MATLAB (MathWorks) via a real-time processor (RX8, Tucker-Davis Technologies). Mouse response was monitored by two lick ports located anterior to the mouth. Licks were detected as described by O'Connor et al. (2010a) (Fig. 1 A, B). Each lick port consisted of a metal tube connected to a water reservoir via a computer-controlled solenoid valve (LHDA1233215H, Lee Company). Lick port position was monitored using an infrared camera (N08CX-Sentient) and adjusted using a micromanipulator.

Behavioral task
Head-fixed mice were trained to locate a metal pole using their whiskers and to report its position by licking (Fig. 1B). On each trial, the pole was presented in one of three anterior-posterior locations (posterior, middle, or anterior). On trials where the pole was in the middle or posterior location ("go left location" or "go right location"), the correct response was for the mouse to lick one of the two lick ports. Correct responses were rewarded by a drop of water (ϳ10 l). In three cases (mice 32, 33, and 34), animals were rewarded for licking at the right lick port when the pole was in the posterior location, and for licking at the left lick port when the pole was in the middle. In two other cases (mice 36 and 38), the contingency was reversed. Incorrect responses on go left/right trials (licking the wrong side or not licking at all) were punished by time-out (Fig. 1B, hourglass symbol). On trials where the pole was in the anterior location ("no go location"), the correct response was to refrain from licking. Incorrect responses on no go trials (licking) were punished by time-out and tone (frequency, 1 kHz; Fig. 1B, speaker symbol).

Trial structure
Each trial started with the pole in its down position, out of reach of the whiskers (Fig. 1A, right). Licks during this epoch were ignored. Then, at "pole onset," the pneumatic valve opened, causing the pole to move up within reach of the whiskers ( pole travel time, ϳ0.15 s). As in related previous studies, during training, the sound caused by opening of the valve tended to trigger reflexive licks, unrelated to mouse choice (O'Connor et al., 2010a;Guo et al., 2014b). To exclude these, for a short grace epoch following pole onset (typically 0.5 s for the full task, defined below), licks were ignored.
The grace epoch was immediately followed by a response epoch. During this time period, mouse licking could control water delivery (typical duration, 2 s for the full task). If, during the response epoch of a go trial, a mouse licked the correct lick port, the first lick triggered the onset of a drink epoch: the water valve opened, making a drop of water available at the lick port. Drink epoch duration varied over the course of training (typically 0.5-2 s). At the end of the drink epoch, the pneumatic valve closed, causing the pole to move back to its down position, and the trial terminated ( Fig. 1A, right). If, during the response epoch, a mouse did not lick or licked the incorrect lick port, it was punished by a time-out epoch (typically 2-10 s). If, during the response epoch of a no go trial, a mouse did not lick, the trial was terminated at the end of the response epoch, causing the pole to return back to its down position. If, instead, the mouse licked one of the lick ports, there was a time-out epoch, at the end of which the pole returned to its down position.

Training protocols
The mouse training process was divided into successive protocols of increasing complexity, following O' Connor et al. (2010a) and Guo et al. (2014b). Transition from one protocol to the next was performed only if the mouse showed stable performance (ϳ70%) on at least 2 consecutive days ( Fig. 2A). The typical sequence of training protocols was as follows.
Lick. First, mice were trained to associate whisker-pole contact with availability of water from the lick ports. Whenever the pole moved up into one of the two go locations, a drop of water was delivered. After a few trials, mice started to lick in response to the pole movement, triggering water delivery via the lick sensor.
Go-no go. Next, mice were trained to lick selectively based on pole location. On each trial, the pole was presented in one of two alternative locations: the posterior go location or the anterior no go location. Only one lick port was within reach. The mouse was rewarded for licking when the pole was presented in the go location. The mouse was punished (by time-out) for both false alarms (licking on no go trials) and misses (not licking on go trials). When the mouse reached stable performance (ϳ70% correct performance) with its full whisker array, all whiskers except for C row were trimmed to fur level. This whisker configuration was maintained by repeated retrimming over the successive days/ weeks. If trimming caused a drop in mouse performance, training continued with a single row of whiskers in the same protocol used before trimming, until performance returned to its pretrimming level.
Lick left-lick right. Next, mice were trained to lick to a specific lick port based on pole location. On each trial, the pole was presented in one of two alternative go locations: the posterior go location or the middle go location. Each pole location was designated a lick port (e.g., posterior with right lick port and middle with left). On presentation of the pole, the mouse was rewarded if it licked the designated lick port. The mouse was punished by time-out if it either licked the nondesignated lick port or failed to lick.
Lick left-lick right-no lick. Finally, mice were trained on the complete task (full task), involving three pole locations (posterior, middle, and anterior) and three behavioral responses (lick left, lick right, and do not lick). Once performance reached ϳ70% correct, all whiskers except one (C1 or C2) were trimmed to the level of the fur (with retrimming as necessary).
On each protocol, from go-no go onwards, mice were first trained with trials in blocks of the same type ("On policy") and subsequently with trials in a pseudorandom sequence (AB policy, see below).
On policy. Here, trials were presented in blocks of the same pole location. The pole location was changed only once the mouse performed a criterion number of consecutive trials (typically three to eight) correctly.
AB policy. Here, the type of each trial was determined randomly, subject to the constraint that runs of the same pole location were limited to a maximum (typically three). We either used the same probability for each trial type (most sessions) or the same probability for go and no go trials. During early training, probabilities could be adjusted to correct mouse bias.
During a typical training session in the full task, a few trials at the beginning of the session were delivered using the On policy before switching to the AB policy ( Fig. 2A).  Whisker movements and whisker-pole interactions were filmed with a high-speed camera (1000 frame/s). Right, Schematic of a correct go trial to illustrate the trial structure (colored bars, defined in Materials and Methods). Whisker angle, whisker curvature, and whisker-pole touches were extracted from the high-speed video. Mouse choice was monitored by measuring the time of first lick. B, Trial-choice 4 outcomes and how they were rewarded/punished. C, Mouse behavior during an example experimental session. Whisker angle (left) and whisker curvature (right) for each whiskertracked trial (see Material and Methods). In the top panels, trials are sorted according to chronological order during the session. In the bottom panels, trials are sorted first by pole location, and, within each pole location, by mouse choice.

High-speed whisker imaging
(2016). Briefly, whiskers ipsilateral to the pole were illuminated from below using an infrared (940 nm) LED array: infrared illumination was used to avoid visual cues to pole location. Whiskers were imaged in the horizontal plane using a high-speed camera (1000 frames/s, 0.4 ms exposure time, Mikrotron).

Whisker tracking and touch detection
The large number of trials and sessions imaged necessitated automatic whisker tracking requiring minimal user intervention. In this study, we tracked only those sessions in which the mice performed the task at criterion with a single whisker (ϳ10 7 frames). To extract whisker position/shape from the high-speed imaging data, we first applied the "Whisk" whisker tracker (Clack et al., 2012). The tracker output was then checked by an automated quality-control program to identify misclassified or poorly tracked video frames, based on expected whisker length and location within the image.
To avoid whisker-tracking errors close to the face due to fur and whisker pad movement, we used, following Pammer et al. (2013), a face-fur mask. The mask was the mouse snout contour (Bale et al., 2015) translated 30 pixels away from the snout border. Whisker bending (curvature) and whisker position (whisker angle) were computed at the intersection of the whisker and the mask by fitting a quadratic curve to a segment of the tracked whisker distal to the mask. Whisker angle was defined as the angle of the tangent to the whisker (at the intersection) with respect to the anterior-posterior axis of the mouse (0 o corresponded to the anteriorposterior axis in the nose to tail direction).
To detect the onset and offset times of whisker-pole contact with millisecond accuracy, we developed a semiautomatic touch detection graphical user interface (GUI). Pole location in each video frame was determined by convolution with a circular pole template. The minimum distance between pole center and tracked whisker was calculated in each frame and putative touches identified as when this distance was lower than a user-defined threshold. The user then used the GUI to confirm putative touches and to curate their timing to frame-rate precision. In this way, we identified "touch episodes" on each trial, where each touch episode was a continuous sequence of frames, each having a confirmed touch. On each trial, the first touch was classified as protraction or retraction based on the phase of the Hilbert transform of the whisker angle time series (Kleinfeld and Deschênes, 2011) and manual curation. During touch curation, whisker-tracking output was also visually inspected. For a subset of the data (5 ⅐ 10 5 frames), we detected and classified as protraction or retraction all touches in every trial.
If a frame failed the above quality-control procedure, that frame was classified as "dropped." If dropped frames occurred during the first touch, that trial was either retracked or discarded. The curvature/angle of occasional, isolated dropped frames was corrected by interpolation of values from adjacent frames.

Behavioral and imaging data analysis Quantification of learning time and asymptotic performance of mice
In this study, mouse performance (task performance) was quantified as the proportion of trials on which mouse choice was correct during a session. We considered only AB trials of single whisker sessions in which the mouse was performing the full task, and we compared the actual performance to that expected if the mouse responded randomly. To this end, we shuffled the pole location sequence with respect to the mouse choice sequence and computed the proportion of correct trials. By repeating this procedure 10,000 times, we estimated the mean and 95% confidence interval on task performance attributable to chance. We con- Figure 2. The three-choice object localization task is whisker-dependent. A, Top, Task performance of mouse 33 during the course of training. The mouse was initially trained with all its whiskers intact. The whiskers were progressively trimmed to one whisker and, finally, as a control, to none. Colored lines indicate the protocol the mouse was trained on each day: lick (cyan), go-no go (red), lick left-lick right (green), lick left-lick right-no lick (gold; protocols are detailed in Materials and Methods). When cyan and red lines overlap, it indicates that the protocol was switched to the go-no go protocol during the same behavioral session. Bottom, Total number of trials performed each day. B, Stable performance for each mouse during AB trials of the full task with a single whisker. Stable sessions were selected as detailed in Materials and Methods. Purple dots show performance in each session, and large black dots and black error bars show mean and SD across selected sessions, respectively. Gray dots and gray error bars show chance performance and 95% confidence interval on chance, respectively. C, Task performance during AB trials in the five sessions before (purple) and two to three sessions after (black) whisker trimming, for each of five whisker-trimming tests. D, Grand mean task performance on sessions before (dark purple) and after (black) whisking trimming. Error bars indicate SD. *p ϭ 0.0013 (t test). Dotted lines, average chance range (see Materials and Methods).
sidered a mouse to have learned the task when performance exceeded the 95% chance confidence interval on three consecutive sessions. We defined asymptotic performance as the performance averaged over eight consecutive, above-chance sessions as close as possible to the end of training (mice 32, 36, and 38) or just before the second whisker trimming (mice 33 and 34; Fig. 2A).

Analysis of whisker movement
To quantify whisker movement during the task, we computed whisking amplitude from whisker angle as detailed in Campagner et al. (2016).

Classifiers: input and output variables
To quantify how well a set of one or more "predictor variables" (sensory variables such as bending moment magnitude and variables reflecting choices on previous trials) might predict a mouse's choices on a trial and to quantify how much information they contain about the actual pole location, we used a classifier-based approach. Classifiers were trained to predict mouse choice or pole location based on one or more predictor variables obtained from (1) the whisker-tracking and touch scoring procedures detailed above and (2) the mouse's choice on the previous trial. The predictor variables were as follows.
Presence/absence of touch. Presence/absence of touch (PAT) is a binary variable scoring whether or not the whisker touched the pole on a given trial before the mouse choice.
Touch type. Touch type is a three-valued variable scoring whether the first whisker-pole touch on a trial occurred during retraction or protraction or, alternatively, if touch was absent. ⌬ 95 . ⌬ 95 is a continuous-valued variable measuring bending moment during the first whisker-object touch on a given trial. During touch, a whisker bends. The curvature () at a given point along the whisker shaft is equal to the sum of the intrinsic curvature of the unbent whisker and a change in curvature (⌬) due to the whisker-object contact (Solomon and Hartmann, 2006). At a given point along the whisker shaft, ⌬ is proportional to the bending moment around the axis normal to the imaging plane through that point (Birdwell et al., 2007;Campagner et al., 2017). ⌬ 95 is a noise-robust, scalar index of the largest ⌬ during the first touch episode of a given trial. For each frame f of the first touch episode, ⌬( f ) was computed by subtracting from ( f ) the median curvature in the 6 ms before touch onset. The 5th and 95th percentiles of these ⌬ values were calculated and ⌬ 95 set equal to whichever had greater absolute value. If no touch occurred during the trial, ⌬ 95 was, by definition, zero.
Choice type. Choice type is a six-valued variable indicating both the mouse's choice in a given trial and whether or not it was correct.

Classifiers: training and testing procedure
The classifiers used were as follows: the PAT classifier ( predictor variable was presence/absence of touch), a touch type classifier ( predictor variable, touch type), ⌬ 95 classifier ( predictor variables, touch type and ⌬ 95 ), and previous choice classifier ( predictor variable, choice type in the previous trial).
To attempt to classify pole location from predictor variables, we used maximum a posteriori probabilistic classifiers (implemented in Matlab using the function fitcnb). For each mouse, the training/testing data consisted of a vector Y specifying the pole location (y) on each trial and a matrix X specifying the predictor variables on each trial. Y consisted of T rows: each element y was a ternary scalar (k ϭ 1, 2, 3, corresponding to the anterior, middle, and posterior locations, respectively). X consisted of T rows and R columns: each row specified the value of R predictor variables (x 1 , x 2 , …, x R ) on a given trial.
As detailed below, we used the training data to estimate, for each trial, P(y ϭ k͉x 1 , . . ., x R ), the posterior probability that pole location was class k, given the predictors: Here ( y) is the prior probability of pole location y (determined from relative frequencies within the training set), and P(x j ͉y) is the probability of predictor x j conditional on pole location. The R predictors were assumed to be conditionally independent given pole location. For each trial, the pole location predicted by the classifier was set to that with the maximal posterior probability over k. The distributions P(x j ͉y) for categorical predictors were described by multinomials; those for continuous predictors were approximated as Gaussians. Classifier accuracy did not change when the latter distributions were described nonparametrically.
To avoid overfitting, we used tenfold cross-validation. The trials were randomly allocated across folds. The trials of each fold (10% of the data set) were used for testing the classifier, with the remainder (90% of the data set) used for training. Classifier performance was computed after concatenating the prediction outcomes obtained from each of the 10 folds. The classifier chance level, and the confidence interval on it, were computed by shuffling the relationship between trial type and mouse choice and repeating the cross-validation procedure (50 iterations).
We used two different metrics to quantify classification performance. "Classifier performance" was the proportion of trials for which the classifier correctly predicted pole location. "Classifier mouse-choice consistency" was the proportion of trials for which the classifier made the same choice as the mouse (using the mapping between pole location and correct choice defined above).
We also trained classifiers to predict mouse choice instead of pole location. The procedure was as described above, except that y specified mouse choice on each trial (a ternary scalar representing whether the response was lick left, lick right, or no lick).

Quantification of perseveration
The probability of perseveration was computed as the proportion of whisker-tracked trials in which choice in the current trial was identical to that in the previous trial. Chance levels for probability of perseveration were computed by random shuffling as described above.

Experimental design and statistical analyses
No statistical methods were used to determine sample size. We did not exclude any animal from the data analysis. Trial types during the behavioral task were randomly determined by a computer program during the experiment. Numbers of iterations of shuffled tests and statistical test types are described in Results and above in Material and Methods.

Results
The three-choice object localization task To investigate active perceptual decision making, our aim was to develop an active touch task that challenged mice to use rich mechanosensory cues while allowing the sensory input that guided decisions to be precisely measured trial by trial with millisecond resolution. To this end, we trained mice to perform a novel, three-choice object localization task with their whiskers (Fig. 1A-C). Head-fixed animals were trained to use one whisker to localize a metal pole in a dark, sound-proofed enclosure under infrared illumination. On any given trial, the pole was presented in one of three locations (anterior, middle, or posterior) along the anterior-posterior axis of the mouse. Mice were trained to associate each pole location with a unique response: lick at left lick port (left lick), lick at right lick port (right lick), or refrain from licking (no lick; for two mice, the contingencies were reversed; see Materials and Methods). There were, therefore, nine possible trial-choice outcomes, three correct and six incorrect (Fig. 1B). For clarity, in the rest of this paper, we label each choice according to the pole location for which that choice was correct. For the example in Figure 1B, when the pole was presented in the posterior location, the correct choice was a right lick (posterior choice).
Mice were first trained to perform the task with all whiskers. The number of whiskers was progressively reduced by trimming until, in the final phase of training (full task), mice performed the task with only one whisker ( Fig. 2A, dark purple dots). Mice learned the full task in 36 Ϯ 12 days of training (mean Ϯ SD across mice) and performed 179 Ϯ 39 trials per daily session (grand mean across both mice and sessions Ϯ SD of session means across mice; Fig. 2A). We expressed a mouse's task performance as the proportion of trials on which its choice was correct. Mice reached stable task performance of 0.74 Ϯ 0.08 (grand mean Ϯ SD of session means; see Materials and Methods), and the performance of all mice was above chance (Fig. 2B). To verify that mice were relying on their whiskers to perform the task, we trimmed the whiskers of fully trained mice and retested. As expected, task performance dropped significantly (t test; p ϭ 0.0013; Fig. 2C,D), from 0.72 Ϯ 0.04 (grand mean Ϯ SD of session means) before trim to 0.36 Ϯ 0.02 after trim. Post-trim performance was within a 95% confidence interval of chance (Fig. 2C, D; see Materials and Methods). In sum, these results indicate that mice can learn a three-choice object localization task using a single whisker.

High-speed imaging and whisker tracking
The fact that mice localized the pole using only one whisker drastically limits the sensory input available to the mouse to guide its decisions and makes it feasible to experimentally measure that input on a trial-by-trial basis. To investigate how mice made choices on the task, we used high-speed imaging (1000 frames/s) both to measure whisker movement and to estimate whisker bending during whisker-pole touch (Fig. 1A, right, C). Due to the high volume of imaging data (ϳ3 ϫ 10 8 frames), we selected for detailed analysis 7.4 Ϯ 2.7 sessions per mouse, where the animal was performing the full task with a single whisker. For analyses of these data, we pooled trials across sessions; thus, task performance is reported as mean Ϯ SD across mice. The data comprised 761 Ϯ 175 trials per mouse. Task performance in these sessions (0.74 Ϯ 0.05) was consistent with that reported above and was above chance at all three pole locations (posterior, 0.77 Ϯ 0.07; middle, 0.75 Ϯ 0.06; anterior, 0.70 Ϯ 0.06; see Fig. 4A).
We tracked the location and shape of the whisker in every frame of the selected sessions (see Materials and Methods). To quantify whisker movement (kinematics), we extracted the angle of the whisker near its base. As a proxy for bending moment, we measured the curvature of the whisker near its base relative to its intrinsic, contact-free value (Figs. 1 A, C, 3 A, B).
Consistent with previous work on two-choice pole localization (O'Connor et al., 2010a;Guo et al., 2014b), we found that mice adopted a stereotyped whisking strategy. At the start of a trial, before pole movement, mice whisked little (Figs. 1A right, C,  3 A, B). Shortly after the onset of pole movement, all mice started to whisk (Fig. 3C).

Whisker bending direction and magnitude predict mouse choice
To investigate the mechanosensory cues that informed mouse choices, we first applied a touch detection algorithm to the imaging data to register, on each trial, whether or not a mouse touched the pole with its whisker (see Materials and Methods), and tested whether the most elementary cue, presence/absence of touch on a given trial (PAT), might be informative. We found that touches occurred at all pole locations: almost always at both posterior (0.87 Ϯ 0.10) and middle (0.93 Ϯ 0.05) locations, and less often (0.46 Ϯ 0.15; t tests, p Ͻ 0.004) at the anterior location (mean Ϯ SD across mice; Fig. 4B). This suggests that PAT is unlikely to fully differentiate pole location. To test this quantitatively, we computed the ability of a probabilistic classifier (PAT classifier) to predict pole location from PAT only (see Materials and Meth-ods). We measured classifier performance, in the same way as mouse performance, as the proportion of trials for which it predicted pole location correctly. We measured classifier-mouse choice consistency (abbreviated to "choice consistency") as the fraction of trials in which mouse and classifier made the same choice. We found that performance of the PAT classifier (0.53 Ϯ 0.06; mean Ϯ SD across mice) was significantly lower than that of the mice (0.74 Ϯ 0.05; t test, p ϭ 1.8 ⅐ 10 Ϫ4 ) and that choice consistency was mediocre (0.53 Ϯ 0.07; Fig. 4C) but above chance (Fig. 4C, right column, red dots; see Materials and Methods). These results confirm that this task challenges mice to use sensory cues richer than PAT.
Which additional mechanosensory cues might be guiding mouse choice? PWNs are sensitive to the direction of whisker deflection (Gibson and Welker, 1983;Lichtenstein et al., 1990;Bale and Petersen, 2009;Bale et al., 2013;Maravall et al., 2013) and have recently been shown to encode both the direction and magnitude of the bending moment associated with whisker-object active contact during behavior (Campagner et al., 2016;Severson et al., 2017). We wondered whether these cues-information that is redundant in simpler tasks-might account for the mouse performance.
To test whether bending moment direction might be an informative cue, we first classified each trial according to whether the first whisker-pole touch on the trial occurred during protraction or retraction. Retraction and protraction touches cause bending in opposite directions (Fig. 3A). The touch type on each trial was scored from the imaging data as either no touch, protraction touch, or retraction touch (Fig. 5A). First touch was a good proxy for subsequent touches on a given trial. Eighty-four percent of trials had at most three touches, 94% of second touches were identical in type to the first, and 98% of third touches were identical in type to the second.
We found that touch types differed in frequency at each pole location ( Fig. 5A; one-way ANOVAs, p Ͻ 10 Ϫ5 ). The posterior pole location tended to elicit retraction touch, the middle location protraction touch, and the anterior location no touch or protraction touch. This suggests that the mouse whisking strategy was to adjust the whisking set point to a position intermediate between the middle and posterior pole locations. In this way, whisking would tend to cause whisker-pole contact during protraction for the anterior/middle locations and contact during retraction for the posterior location. These data indicate that direction of touch could potentially be a useful cue. To test this, we used the classifier approach to quantify how well pole location on a trial could be predicted from touch type (touch type classifier). We found that the touch type classifier not only performed better than the PAT classifier (0.67 Ϯ 0.05 vs 0.53 Ϯ 0.06; t test, p ϭ 0.0011), but also that its choice consistency was higher (0.63 Ϯ 0.09 vs 0.53 Ϯ 0.07; t test, p ϭ 0.0066; Fig. 5B), although to a variable extent across mice (Fig. 5E). However, the touch type classifier performed significantly worse than the mice (0.74 Ϯ 0.05; t test, p ϭ 5.5 ⅐ 10 Ϫ4 ). Thus, touch type is informative but not sufficient to account fully for mouse performance.
We considered the possibility that mice might be able to use a continuous readout of bending moment as a cue. When a whisker strikes an object, it bends and its curvature changes. We computed a simple index sensitive to bending moment magnitude during first touch, termed ⌬ 95 (see Materials and Methods). ⌬ 95 is a robust measure of the most extreme value of curvature change (⌬) during a given touch. We found that ⌬ 95 was variable, but depended systematically on pole location (Fig. 3A, 5C). Protraction touch was typically associated with positive a ⌬ 95 (t test, p ϭ 7 ⅐ 10 Ϫ5 ) and retraction touch with a negative ⌬ 95 ( p ϭ 0.0043). For each mouse, for retraction and protraction touches, the magnitude of ⌬ 95 was dependent on pole location (two-way ANOVAs, p Ͻ 10 Ϫ8 ). These data suggest that bending moment magnitude is a potential cue to pole location. To test whether ⌬ 95 might permit improved task performance compared to touch type alone, we again used the classifier approach. We trained a classifier given input of both ⌬ 95 and touch type to predict pole location (see Materials and Methods). This classifier performed as well as the mice (0.72 Ϯ 0.03 vs 0.74 Ϯ 0.05, respectively; t test, p ϭ 0.21) and, overall, significantly better than the touch type classifier (Fig. 5D; t test, p ϭ 0.038). Choice consistency for the ⌬ 95 -touch type classifier was 0.66 Ϯ 0.05 (mean Ϯ SD across mice), but variable across mice (Fig. 5E). For the three mice where consistency between mouse choice and the touch type classifier was highest, the ⌬ 95 -touch type classifier did not increase choice consistency. In contrast, for the two mice where consistency between mouse choice and touch type classifier was lowest, the ⌬ 95 -touch type classifier increased choice consistency. Choice consistency for the ⌬ 95 -touch type classifier was higher than that of the ⌬ 95 classifier (t test, p ϭ 0.0025). These findings indicate that bending moment strength and directionquantities that PWNs are known to encode-can account for the ability of mice to perform the task substantially more accurately than a strategy based purely on the presence/absence of touch. The findings also indicate that individual mice differ in the exact weight that different mechanical variables have in their decisions.

Choices on previous trials predict performance on error trials
The analysis above considered both trials where the mouse chose correctly (correct trials) and those where it chose incorrectly (error trials). To get further insight into mouse decision making, we selectively investigated errors (Fig. 1B). One possibility is that errors might be driven by current sensory input, for example, due to an unusual touch on a particular trial. Alternatively, errors might be driven by memory of outcomes on previous trials (Kiyonaga et al., 2017;Akrami et al., 2018). We asked how well the best of the classifiers considered above (that with both touch type and ⌬ 95 as inputs) could predict mouse choice on error trials. Consistent with the data reported above, this classifier was accurate on correct trials (0.77 Ϯ 0.03). In contrast, the classifier was remarkably inaccurate on error trials: on average, choice consistency on error trials was significantly lower than that on correct trials (0.35 Ϯ 0.1 vs 0.77 Ϯ 0.03; t test, p ϭ 4 ⅐ 10 Ϫ4 ) and for only one mouse was it above chance (Fig. 5D). This suggests that there might be an important nonsensory contribution to choices on error trials.
To test for a possible contribution to choice from previous trial outcomes, we first examined the time sequence of mouse choices. We found that mice showed a strong tendency to make the same choice on consecutive trials, that is, to perseverate ( Fig.  6 A, B). The probability of perseveration on error trials (0.63 Ϯ 0.02) was substantially above chance for all individual mice and significantly greater than that on correct trials (0.63 Ϯ 0.02 vs 0.36 Ϯ 0.02; t test, p ϭ 1.4 ⅐ 10 Ϫ5 ). Perseveration was not simply a consequence of response bias since those mice for which the three choice types were statistically equally likely ( 2 test, p Ͼ 0.26) still showed significant perseveration. The most common perseverating behavior leading to error was that when a mouse got a trial correct, it tended to repeat the successful choice on the next trial (Fig. 6D). Indeed, when tested on error trials, a classifier trained to predict choice based on that in the previous trial was substantially more accurate than a classifier trained to predict choice based on sensory input (0.58 Ϯ 0.08 vs 0.35 Ϯ 0.1; t test, p ϭ 0.0076; Fig. 6C). In contrast, when tested on correct trials, the choice-based classifier was less accurate (0.41 Ϯ 0.03 vs 0.77 Ϯ 0.04; t test, p ϭ 4 ⅐ 10 Ϫ5 ; Fig. 6C). Taken together, these results indicate that two competing mechanisms governed mouse deci- Red dots indicate that performance of a given mouse was outside 95% confidence interval on chance (5000 shufflings). B, Probability of touch as a function of pole location. Gray lines indicate individual mice. C, Task performance of mouse and PAT classifier along with choice consistency. Red dots indicate that the classifier/mouse performance or choice consistency was significantly higher than chance. Black circles report mouse behavioural data. Orange circles report PAT classifiers outcome. Empty circles and error bars show means and SDs across mice, respectively. *p ϭ 1.8 ⅐ 10 Ϫ4 (t test).

Figure 5.
Whisker bending magnitude and direction account for mouse choice. A, Probability of each touch type as a function of pole location (mean and SD across mice). B, Performance of touch-based classifiers compared to mice. Red dots indicate that corresponding classifier/mouse performance or choice consistency was significantly greater than chance for the given mouse. Orange circles show mean classifier performance and choice consistency of the PAT classifier. Light blue circles show mean classifier performance and choice consistency of the touch type classifie Error bars indicate SD. C, Mean ⌬ 95 of each touch type as a function of pole location for all mice. Error bars indicate SEM. D, Performance of touch type-and bending-based classifiers compared to mice. Red dots indicate that corresponding classifier /mouse performance or choice consistency was significantly greater than chance for that mouse. Dark blue circles show mean classifier performance and choice consistency of the ⌬ 95 -touch type classifier. Light blue circles are same data as in B). Error bars indicate SD. E, Single mouse values of touch type only and touch type-⌬ 95 choice consistency. *p Յ 0.05 (t test). sion making during the task, driven by choice-memory and current sensory input, respectively.

Discussion
When making perceptual decisions under natural conditions, animals move their sense organs (active sensation). We developed a new active sensation task that challenges mice to use multiple mechanosensory cues while allowing the sensory input that drives decisions to be measured at millisecond resolution. In this three-choice task, mice use a single whisker to localize a pole. We found that competing sensory and internal processes influenced decision making, and we identified both mechanosensory and choice-memory signals that accurately predicted mouse choice.

A new task for investigation of active perceptual decision making
Our study builds on previous work that developed whisker-based object localization in head-fixed mice, along with a mechanics framework and experimental methods for estimating the me-chanical forces associated with whisker-pole interaction (Birdwell et al., 2007;O'Connor et al., 2010a;Clack et al., 2012;Pammer et al., 2013;Campagner et al., 2016Campagner et al., , 2017. Our task is novel compared to previous rodent object localization tasks in that it is a three-choice task. The task maintains the ability to estimate whisker mechanical forces, but requires animals to use multiple mechanosensory cues, including the direction of bending moment.

Mechanosensory basis of active touch
We found that correct choices could be predicted with high accuracy from the direction and magnitude of whisker bending. Neurons throughout the whisker system are sensitive to the direction of passive whisker deflection (Gibson and Welker, 1983;Simons and Carvell, 1989;Lichtenstein et al., 1990;Bale and Petersen, 2009;Maravall et al., 2013). During active whisker-object contact, the activity of PWNs primarily reflects bending moment: torque generated as contraction of the whisking muscles cause the whiskers to bend against the object (Bush et al., 2016; Cam-Figure 6. Previous choice predicts error trials. A, Sequence of 31 consecutive trials performed by an example mouse. Red, blue, and gray rectangles respectively indicate trials in which the pole location was anterior, middle, and posterior (the top row), and in which the mouse made posterior, middle, and anterior choices (bottom row). Triangles indicate error trials, and dark red triangles indicate error trials in which the choices in the previous and current trials were identical (i.e., the mouse perseverated). B, Probability of perseveration for each mouse (gray lines) under different conditions: considering all trials (left), correct trials only (middle), and error trials only (right). The green line indicates the example mouse in A. Black circles indicate the means; black error bars indicate SD across mice. *p Յ 0.0167 (t test; Bonferroni correction, n ϭ 3). Gray bars indicate the chance interval (10,000 shuffling, 95% confidence interval). C, Performance of classifiers predicting mouse choice on correct trials only (left) and error trials only (right). Blue and yellow circles indicate mean values for the ⌬ 95 -touch type classifier and previous choice classifier respectively. Small dots are single mouse values. Red indicates that the classifier performance value for the mouse was above chance. Error bars indicate SD across mice. *p Յ 0.05 (t test). D, Probability of perseveration during error trials depending on whether the previous trial was a correct trial or an error trial. *p ϭ 3.4 ⅐ 10 Ϫ4 (t test). Black error bars indicate chance intervals of each mouse (10,000 shufflings, 95% confidence interval). pagner et al., 2016;Severson et al., 2017;for review, see Campagner et al., 2017). PWNs robustly encode both the direction and magnitude of bending and transmit this information along the ascending thalamocortical pathway (Yu et al., 2006(Yu et al., , 2016O'Connor et al., 2010b;Huber et al., 2012;Petreanu et al., 2012;Xu et al., 2012;Hires et al., 2015;Moore et al., 2015;Peron et al., 2015b;Gutnisky et al., 2017). A wide range of PWN properties (Zucker and Welker, 1969;Gibson and Welker, 1983;Lichtenstein et al., 1990;Szwed et al., 2003;Jones et al., 2004;Arabzadeh et al., 2005;Leiser and Moxon, 2007;Bale and Petersen, 2009;Lottem and Azouz, 2011;Bale et al., 2013;Maravall et al., 2013) can be concisely explained by this framework (Campagner et al., 2017). Thus, the cues we found to predict choices are consistent with physiological properties of somatosensory neurons. They are also consistent with biomechanical modeling studies Huet et al., 2017).
Sensing of bending moment provides a simple account for how rodents solve a number of whisker-dependent tasks. Mice solve two-choice, anterior-posterior pole localization tasks by a selective whisking strategy: the strength and number of touches is sufficient to guide to pole location (Introduction; O'Connor et al., 2010a). In our three-choice task, mice whisked in such a way that they contacted the pole at all three locations. Mice solved the task by focusing their whisking at a location intermediate between the anterior and posterior pole locations. In this way, on trials where the pole was located anterior/middle, touch typically occurred during the forward (protraction) phase of whisking, whereas on trials where the pole was posterior, touch typically occurred during the backward (retraction) phase. Thus, direction of bending was informative about pole location. In addition, touches at the anterior location, when they occurred at all, were weaker (bending magnitude was lower) than those at the posterior/middle locations, so that bending magnitude was also informative about pole location. In addition to object localization, sensing of bending moment also accounts for wall-following behaviors (Sofroniew et al., 2014). Sensing of bending moment may also permit whisker-based inference of object shape (Solomon and Hartmann, 2006) and of the spatial structure of the environment (Fox et al., 2012;Pearson et al., 2013). Some active touch tasks may require multidimensional mechanosensory signals, for example, axial force in combination with bending moment (Bagdasarian et al., 2013;Pammer et al., 2013). The role of bending moment in texture discrimination tasks, which have mainly been analyzed in terms of stick-slip events (Wolfe et al., 2008), requires further research: dynamic signals, such as rate of change of bending moment, may be important here. Overall, bending moment sensing provides both a paradigm for future investigation of neural algorithms of active touch and an inspiration for further development of tactile robotics.