Neural Basis of Number Sense in Larval Zebrafish

Number sense, the ability to discriminate the quantity of objects, is crucial for survival. To understand how neurons work together and develop to mediate number sense, we used two-photon fluorescence light sheet microscopy to capture the activity of individual neurons throughout the brain of larval Danio rerio, while displaying a visual number stimulus to the animal. We identified number-selective neurons as early as 3 days post-fertilization and found a proportional increase of neurons tuned to larger quantities after 3 days. We used machine learning to predict the stimulus from the neuronal activity and observed that the prediction accuracy improves with age. We further tested ethanol’s effect on number sense and found a decrease in number-selective neurons in the forebrain, suggesting cognitive impairment. These findings are a significant step towards understanding neural circuits devoted to discrete magnitudes and our methodology to track single-neuron activity across the whole brain is broadly applicable to other fields in neuroscience.


Significance
• Numerically responsive neurons are detected by 3 days post-fertilization (dpf) in zebrafish ○ Number-selective neurons preferring quantities greater than one increases after 3 dpf • Neurons that are highly responsive to specific numbers of objects are mainly localized to the forebrain and midbrain • Number stimulus can be decoded from Ca 2+ activity and show increased performance with age • Administration of ethanol decreases the activity of number-selective neurons in the forebrain

Introduction
Understanding quantity, whether discrete (countable) or continuous, is fundamental for survival, e.g. for avoiding predators, finding food, mating, and other group behaviors (Alder & Rose, 2000;Cross & Jackson, 2017;Edwards et al., 2002;Templeton & Greene, 2007).Quantity estimation, often referred to as the Approximate Number System (ANS), allows both humans and animals to intuitively estimate numerosity, or quantity of objects in a set, without precise counting (Brannon & Merritt, 2011;Piazza, 2010;Piazza et al., 2004).The ANS develops during early infancy, highlighting its importance as a foundational aspect of cognition (Xu & Spelke, 2000).The ANS forms the basis of survival instincts to complex mathematical abilities, ultimately shaping how we perceive and interact with the world (Bonny & Lourenco, 2013;Feigenson et al., 2004;Szkudlarek & Brannon, 2017).
Current studies are limited to identifying individual neurons or specific brain regions responsible for number sense, but understanding how a network of number-selective neurons functions across the entire brain remains elusive (Ditz & Nieder, 2015, 2016;Messina, et al., 2022aMessina, et al., , 2022b;;Pfeifer et al., 2018;Piazza et al., 2004;Viswanathan & Nieder, 2013).In primates, Viswanathan & Nieder (2013) showed a visual sense of number mapped to the parietal and prefrontal cortices.Expanding on this, recent studies suggest that visual number processing extends beyond these regions and involves the superior colliculus, a deep subcortical area (Collins et al., 2017;Georgy et al., 2016).In birds, involvement of several pallial regions has been recently documented by early gene expression (Lorenzi et al., 2024).While the use of electrodes can access individual neurons at multiple regions, it is difficult to unbiasedly capture all neurons especially without neuron damage after implantation (Eles et al., 2018;Ferguson et al., 2019;Goss-Varley et al., 2017).Capturing neuronal activity across the whole brain would enable researchers to map neural circuits involved in ANS processing with unparalleled precision in both encoding and representation..
To address this, we developed and optimized a two-photon fluorescence light sheet microscopy (2P-LSFM) platform (Keomanee-Dizon et al., 2020; Messina, Potrich, Perrino, et al., 2022;Truong et al., 2011;Vito et al., 2020) and a customized data analysis pipeline.This allowed for noninvasive imaging of the functional activity of nearly all neurons across the whole brain in larval zebrafish (Danio rerio) with single-neuron resolution.Larval zebrafish offer many advantages as a model system for studying neural processes such as transparency, genetic tractability, and drug screening applications (Kawakami, 2005

Result
We used our custom-developed 2P-LSFM to record whole-brain neuronal activity of agarose-embedded zebrafish at age 3, 5, and 7 dpf, while the animals were presented with visual numerical stimuli based on dots (Figure 1a, Methods: Calcium imaging).Imaging was acquired at a 1-Hz whole-brain volumetric rate, and the entire imaging experiment lasted for 90 minutes, as the numerical stimuli sequenced from one to five dots.When the quantity of dots changes, non-numerical geometric effects co-vary and can confound the numerical effects.For example, two circles have a higher combined area than one circle of the same diameter.To account for geometric effects, the number-based dot stimuli controlled for both numerical and non-numerical variables (i.e. for continuous physical variables that co-vary with numerosity) (Zanon et al., 2022).The non-numerical variables were divided into spread and size of the individual dots.The Angular diameter of the dots was kept at a minimum of 5°(angular degree) above the visual acuity threshold of 2-3° (Haug et al., 2010).The spread of the dots includes convex hull and distance between the dots, while the dot size includes constant radius, total dot area, and total dot perimeter (Figure 1b).The stimuli sequence includes all possible combinations of spread and sizes using a new pattern for each stimulus (Supplementary Figure 1).To account for any intrinsic neural oscillatory signal that might have a repetitive pattern in phase with the stimulus display, the inter-stimulus interval followed a pseudo-random sequence.
We applied and optimized several publicly available Python tools and software for managing, processing, and analyzing volumetric movie data and neuronal signals.We used VoDEx (Nadtochiy et al., 2023) to manage the 4D (volumetric movie) data and stimuli annotations.Advanced Normalization Tools (Avants et al., 2009) was used to spatially align and correct for motion artifacts in 4D datasets.Registration of multiple samples onto a representative brain template was performed using ITK-SNAP (Yushkevich et al., 2006).
To segment for the signals from individual neurons, we applied the Python toolbox for large-scale Calcium Imaging Analysis (CaImAn) (Giovannucci et al., 2019).See Methods for full details. Figure 1c, d, e shows example images of the raw image data with whole-brain coverage at cellular resolution.The resulting processed segmentation is shown in Supplementary Figure 2.

Neurons correlating to number stimuli are detected early in development
To identify neurons specifically responsive to changes in numerosity (Figure 2a, Supplementary Figure 3) from those responsive to geometric changes, we applied a two-way permutation ANOVA.Neurons were filtered based on a significant main effect for changes in numerosity (p < 0.01), without exhibiting significant main or interaction effects due to geometric changes.We define these filtered neurons as "number-selective neurons".As an example, we present the significant main effect for changes in numerosity during the stimulus onset for a 7 dpf larva (Figure 2b).The analysis window of 3 seconds accounts for the typical ~2 second decay time constant (Dana et al., 2019b;Yang et al., 2022).In general, a significant Ca 2+ response to a numerical stimulus was detected 0-3 seconds from the stimulus onset.
On average, we identified 1300±300, 800±100, 550±100 number-selective neurons, among 14000±2700, 17000±1300, 17000±2000 detected active neurons in 3, 5, and 7 dpf larval zebrafish, respectively (n=5 for each age group) (Supplementary Table 1-5).Due to the varying expression levels of H2B::GCaMP across individual fishes and varying signal-to-noise ratios due to development of the skin (Li & Uitto, 2014) and head (Kimmel et al., 1995), quantification of number-selective neurons are normalized by number preference, detected active neurons, and regions for each sample.Example Ca 2+ signal traces and tuning curves of neurons tuned to 1-5 objects for one fish are shown in Figure 2c.Neurons showing a peak Ca 2+ response to a specific numerosity is defined as tuned or having preference to that numerosity.Tuning curves show a gradual decrease in Ca 2+ response for numerosities further from the preferred numerosity (Figure 2d; for population tuning see Supplementary Figure 4).

Number stimulus can be decoded from number-selective neurons
To determine if the Ca 2+ activity of number-selective neurons across the brain is sufficient to predict the correct number of dots shown during a visual stimulus, we trained a support vector machine (SVM) supervised classifier to estimate the visual stimulus from the recorded activities (Kirschhock & Nieder, 2022).The features were extracted averaging the Ca 2+ activity of all identified number-selective neurons for each preferred numerosity (Figure 5a, Methods).The Ca 2+ activity averages for number preferences 1-5 serve as the five input features and are used to predict six types of stimuli (1, 2, 3, 4, 5 dot, no dot).The classifier was trained on four out of five individual zebrafish in each age group and tested on the remaining one, enabling generalized testing across conspecifics.

Ethanol inhibits number-selective neurons in the forebrain
Acute ethanol exposure affects learning and memory processing in zebrafish (Sartori et al., 2022).To understand how this affects number-selective neurons we examined the effect of ethanol on number-selective neurons of 7 dpf larvae compared to the untreated larvae.
Location of detected number-selective neurons in the forebrain is noticeably less when treated with 1.5% ethanol (Figure 6a).The percentage of number-selective neurons in the ethanol-treated group (10%) showed a significant decrease in the forebrain when compared to detected active neurons in the forebrain brain (20%) and the forebrain of untreated group (39%) (n=5 for each treatment group) (Figure 6b, Supplementary Figure 8).To measure the predictive capacity of number-selective neurons of an ethanol-treated group, we trained a supervised classifier to predict the visual stimulus using the Ca 2+ activity (Figure 6c).The overall accuracy of the ethanol-treated group (41%) was decreased compared to the untreated group (55%) (Figure 6d).This effect is mainly driven by the decreased accuracy when predicting numerosities of 3, 4, and 5.These results suggest ethanol may impair the function of number-selective neurons.

Discussion
In this study, we investigated the neural basis of number sense in larval zebrafish, focusing on the tuning of neurons to specific visual-based numerosities under different conditions.Our work has, for the first time, discovered the existence of number-selective neurons in larval zebrafish.The fast volumetric imaging rate of one volume per second and the high signal-to-noise ratio of light sheet microscopy enabled whole-brain recording and segmentation of approximately 17,500 active neurons per larva.The use of two-photon excitation allowed for increased depth of coverage (deeper imaging) and reduced visual artifacts compared to one-photon excitation (Truong et  ).This finding suggests that the development of these neurons precedes and potentially facilitates these behaviors, highlighting the critical importance of early numerical cognition for survival.
The proportion of neurons tuned to numerosities of two or more shows a trending increase with age (Figure 3a).A significantly increased proportion of neurons preferring 3 objects was detected after 3 dpf (Figure 3b).These results suggest number-selective neurons develop in an ordinal fashion with age.An interesting question for future studies is whether this increase is due to the generation of new neurons preferring higher numerosities or the re-tuning of existing neurons.This could be resolved by application and further refinement of our experimental platform to observe number-selective neurons in the same zebrafish longitudinally over development time.
The increased proportion of neurons preferring larger numerosities (>2) developing after 3 dpf may be caused by an improvement in visual acuity rather than changes to number-selective neurons.However, the zebrafish eye is emmetropic at 3 dpf (Easter & Nicola, 1996), and no differences in visual acuity were detected when comparing larvae at 4, 5, and 6 dpf (Haug et al., 2010).Furthermore, recognition of 5 dots does not require finer visual acuity than 2 dots when maintaining equivalent inter-distances (Figure 1c).Because we detected neurons preferring 2 dots in 3 dpf larvae, the increase of neurons preferring larger numerosities in older larvae is unlikely to be caused by improved visual acuity.
We identified number-selective neurons localized throughout the forebrain and midbrain (Figure 4b).In the 3 dpf group, we found significantly less neurons in the forebrain compared to the midbrain, whereas in the 5 and 7 dpf groups, the forebrain contained a similar proportion of these neurons (Figure 4c), likely due to the forebrain being more developed in the older fish (Cheng et al., 2014).Further analysis of the forebrain subregions found no significant age-related changes in (Supplementary Figure 7, Supplementary Table 6).These results suggest that while overall development affects neuron distribution, the specific sub regional changes may not happen until the brain matures beyond 7 dpf.
In the mammalian brain, most number processing is to our knowledge localized to the prefrontal and parietal cortices (Nieder et al., 2002;Piazza et al., 2004).In non-mammals, such as zebrafish, the pallium generally fulfills the role of the prefrontal cortex (Medina et al., 2019).However, the non-mammalian brain lacks a structure that is directly analogous to the parietal lobe; instead, the optic tectum of the midbrain serves many cortical functions such as sensory processing and spatial perception (Förster et  This suggests that the optic tectum participates in more complex functions than its long-studied roles in visual mapping and sensory integration. To assess the predictive capabilities of the number-selective neurons across 3, 5, and 7 dpf zebrafish, we trained a supervised classifier using their underlying Ca 2+ activity.The prediction accuracy of the classifier increases with age for 2-5 objects, indicating that higher number-selective neurons become more specific (generating more action potentials in response to specific numerical stimuli) as the larval zebrafish matures.Similar to the findings of number sense in crows (Kirschhock & Nieder, 2022), our results show that most misclassifications occurred near the correct choice, suggesting a numerical distance effect (i.e.discrimination errors arise between closer numerosities) (Moyer & Landauer, 1967;Nieder, 2011).From 3 to 5 dpf, the average prediction accuracy of 2, 3, and 5 objects increased from ~30% to ~43%, but interestingly the accuracy of 4 objects remained near random chance (17%) until 7 dpf.
A plausible explanation for the decreased accuracy of 4 objects for 5 dpf fish is that numerosity of 4 represents a transition point between Object Tracking System/Parallel Individuation System (OTS/PIS) and Approximate Number System (ANS) (Feigenson et al., 2004;Hyde, 2011;Sheardown et al., 2022b).The OTS/PIS is thought to be responsible for tracking and representing small quantities of objects with high precision, typically up to four items.Whereas the ANS operates on an approximate level, allowing for rapid estimation of small (<4) and large (>4) numerical magnitudes beyond the capacity of the OTS/PIS.If the OTS develops ordinally then neurons preferring 4 objects would develop last whereas neurons preferring 5 objects would have emerged earlier with the ANS.
When larval zebrafish were exposed to ethanol, the activity of number-selective neurons decreased in the forebrain (Figure 6a-b).Given ethanol's well-known propensity to inhibit information processing in the frontal lobe of humans (Koelega, 1995;Tzambazis & Stough, 2000), it is likely that the number-selective neurons in the forebrain, which are implicated in complex higher-order functions such as learning and memory (Dempsey et al., 2022;Rodríguez et al., 2002), are selectively affected.When predicting the stimulus from the Ca 2+ activity using an SVM classifier, the overall accuracy decreases for larger numerosities (>2) (Figure 6c).Interestingly, the prediction accuracy of 1 dot showed improvement.One possible explanation is ethanol treatment is inhibiting the number-selective neurons part of the ANS system that prefer 1, leaving OTS neurons remaining which have a more precise representation of numbers (Feigenson et al., 2004).
Our findings contribute to the growing understanding of the developmental stages of cognitive abilities in vertebrates, offering new insights into how early neural circuits involved in numerosity evolve even before behaviorally measurable traits emerge.The identification of number-selective neurons in larval zebrafish as early as 3 dpf, well before the onset of numerically-driven behaviors, emphasizes the critical role of early neural development in the establishment of cognitive functions necessary for survival.This study not only adds to the foundational knowledge of numerical cognition in non-mammalian species but also opens avenues for comparative studies across vertebrate models, including primates and humans, to explore the evolutionary conservation of these neural circuits.

Calcium imaging
Zebrafish larvae were embedded in 2% low-melting-point agarose (Invitrogen cat 16520100) and mounted in a custom sample holder.During image acquisition, the larvae were perfused with oxygenated water using a peristaltic pump and heated to 28C.Image acquisition was performed on a custom-built microscope (Keomanee-Dizon et al., 2020) that was further modified by optimizing the polarization and additional laser pulsing to increase the fluorescence signal (Luu et al., 2024;Vito et al., 2020Vito et al., , 2022)).The sample was imaged via two-photon excitation using a Chameleon Ultra II Ti:Sapphire laser (Coherent) at 920 nm with approximately 300 mW peak power and 180 mW average power (combined excitation laser at the sample after splitting).Emitted light was bandpass filtered at 525 ± 45 nm and collected using a 20x 1.0 NA water dipping objective (Olympus).Continuous images were acquired at a rate of 1 second per volume, in which a volume is composed of 60 z-slices at 540 x 296 pixels across 230 µm (~900 x 500 x 230 µm3, equating to a 3.83-µm-thick section) at a pixel resolution of 1.68 µm.The acquisition time per sample is approximately 90 minutes excluding a 30-minute acclimation period totaling ~100gb of data.Software control and hardware synchronization for image acquisition was performed as previously described (Keomanee-Dizon et al., 2020) using µManager (Edelstein et al., 2010b) and LabVIEW.

Stimuli Generation
Dot patterns were generated using GeNEsIS (Zanon et al., 2022) and controlled for convex hull, inter-distance, total area, total perimeter, and radius in (Figure 1b) .Convex hull describes the smallest convex polygon that encloses all of the elements, inter-distance is the average distance between the elements.Total area equates average brightness and cumulative surface area for different numerosities.Total perimeter equates the cumulative circumference of all the elements for different numerosities.The parameters are summarized in Supplementary Table 8.
Note: parameter values apply by use case ("1" dot stimuli does not have convex hull or inter-distance parameters, constant radius does not use radius variability).Angular diameter of dots were kept above 5°to maintain visibility (Haug et al., 2010) and below 18°to minimize an escape response (Temizer et al., 2015).Numerical elements were colored black on a red background to simulate objects' contrast in the natural environment and to prevent disassembly of the photoreceptor of the photoreceptor (Emran & Dowling, 2010).

Visual number-based display
Visual stimuli were projected onto a diffuser placed 19 mm away from the larvae (figure 1a).The diffuser is made of cellulose acetate (Scotch Magic tape) that faces the right eye of the larval fish and is placed orthogonally to its body axis.Illumination was generated using a Qumi Q5 LED Projector (Vivitek) and bandpass filtered at 660 ± 45 nm (Thorlabs).
Each numerical stimulus is presented 48 times following a pseudo-random order.The stimulus is displayed for 1 second followed by varying inter-stimulus intervals of a blank red background between 15-30 seconds.The display area is 22 mm in diameter or 66°in angular diameter.
Stimulus control was performed using the PsychoPy toolkit (Peirce et al., 2019).

Ethanol administration
To determine the appropriate ethanol concentration, we adapted methods from previous studies (Dlugos & Rabin, 2003;Vossen et al., 2022) to assess larval zebrafish swimming behavior and mortality after treatment.In triplicates, five 7 dpf zebrafish were immersed in 15 mm x 100 mm Petri dishes containing 1, 1.5, and 2% ethanol in E3 media for 1.5 hours (image acquisition duration).We then screened for hyperactivity by gently tapping on the Petri dish and chose the 1.5% ethanol concentration for this study.Before image acquisition, the zebrafish were treated with 1.5% ethanol 30 minutes prior and then continuously perfused with oxygenated E3 media containing 1.5% ethanol during imaging.

Cell segmentation
The datasets were first motion corrected using Advanced Normalization Tools (Avants et al., 2009).Cell segmentation was performed using a python library designed for calcium imaging (CaImAn) (Giovannucci et al., 2019).CaImAn consists of a series of functions enabling the separation of neurons using Ca 2+ activity in time and space by applying non-negative matrix factorization.Prior to cell segmentation, the data size was reduced by selecting only the time points around the stimulus presentation (3 s before stimulus + 1 s stimulus + 5 s post-stimulus; see Figure 2).The final volumetric time series was reduced from 5,472 s to 2160 s (9 s window X 5 numerosities X 48 repetitions).Large data handling and annotation were managed using an inhouse python library that facilitated image processing (Nadtochiy et al., 2023).
The segmentation was performed in 2D where each time point consisted of 60 z-slices with the following parameters: 'decay_time' = 5 (length of a typical transient in seconds); 'gSig' = 3x3 (expected half size of neurons in pixels); min_SNR = 1.5 (signal to noise ratio to accept a component); rval_thr = 0.85 (space correlation threshold to accept a component).The 'K' parameter is the expected number of cells to be segmented that serves as a starting point for optimization.Since the number of cells expected in each z-slice varies, the 'K' parameter is estimated based on the standard deviation of Ca 2+ flux in each z-slice over time.The standard deviation image is thresholded (min_std + 0.08*(max_std -min_std)) resulting in an image with pixels that represent cells with Ca 2+ flux.The maximum number of the resulting pixels are then divided by 'gSig' to approximate the number of cells per z-slice.Since a single cell's Ca 2+ signal can span across 2-3 z-slices, we eliminate duplicates by merging cells with both a centroid distance less than 1 pixel and with a Ca 2+ activity correlation coefficient higher than 0.95.

Number neuron selection
Identification of numerically-tuned neurons involved additional preprocessing steps that removed camera shot noise and established a baseline fluorescence.To remove false positive segmented cells caused by the camera shot noise (identified as segmented cells that were found outside of the brain), we calculated the coefficient of variation (CV), the ratio of the standard deviation to the mean, for each timepoint in the peristimulus windows.We found a CV of 0.05 was sufficient to remove false positive cells related to shot noise.Baseline fluorescence (F 0 ) was defined as the average of three time points before the visual stimulus around the stimulus presentation (peristimulus window) for each numerosity.
To differentiate neurons responsive to numerosity from those responsive to nonnumerical covariables (size and spread), we utilized a two-way permutation ANOVA.This involved randomizing the labels associated with the data and calculating the F-value.We repeated this process 10,000 times to construct a null distribution based on simulated F-values to which the actual F-value was compared to get the p-value.The criteria for identifying a number-selective neuron must have a significant main effect for the numerical stimulus (alpha = 0.01), a non-significant main effect for the nonnumerical covariables, and no interaction effect.

Brain spatial registration and region segmentation
All samples were first registered to a brain template of each respective age group with ITKsnap (Yushkevich et al., 2006) using the average Ca 2+ signal in time.All identified neuron centers were remapped to the final brain template to compare across different fish.To identify subregions of the forebrain, we registered the brain templates to the mapZebrain atlas (Kunst et al., 2019) using affine transformation, then selected the available subregion Boolean masks.

Supervised classification
To test the predictive properties of the number-selective neurons, we applied a support vector machine (SVM) based supervised classifier using a linear kernel.The classifier used the underlying Ca 2+ activity to predict the visual number-based stimulus.To extract the features, we calculated the average Ca 2+ activity of the neurons tuned to each of the five numerosities during a 2-second window encompassing the 1-second visual stimulus and the following post-stimulus second.These five average activities served as input features for the SVM.The six classes (true labels) consisted of the five numerosities (1-5 objects from the visual stimulus) and the average Ca 2+ activity during the frames preceding the stimulus representing the no stimulus or background baseline.
We trained the SVM model on each experimental group (3 dpf, 5 dpf, 7 dpf, 7 dpf + EtOH) to classify trials based on the five extracted features.We applied a leave-one-out cross-validation scheme, where the model was trained on data from four fish within a group and tested on the remaining fish.This procedure was repeated five times, each time excluding a different fish.The final confusion matrices (Figures 4b-d, and 5c) were obtained by combining the test results from all five repetitions.

Statistical analysis
Statistical analyses and graph preparation were conducted using: custom python scripts, seaborn library (Waskom, 2021), Inkscape.

Figure 1 .abc
Figure 1.Application of two-photon fluorescence light sheet microscopy to detect neuronal representation of number perception in larval zebrafish.

Figure 3 .a
Figure 3. Populations of neurons tuned to specific numerosities show redistribution of number preference during early development.

Figure 4 .
Figure 4. Number-selective neurons are primarily detected in the forebrain and midbrain.

Figure 5 .a
Figure 5. Prediction accuracy of the numerical stimuli from Ca 2+ activity using SVM classifier shows increased performance with age.

Figure 6 .abc
Figure 6.Ethanol alters the activity of number-selective neurons in the forebrain.
(Adam et al., 2024;Lucon-Xiccato et al., 2023bylkov et al., 2022)and human infants(Izard et al., 2009;Xu & Spelke, 2000), we detected number-selective neurons during early post-embryonic (equivalent to post-natal) stages in zebrafish.Notably, we observed these neurons at 3 dpf, which is before the onset of known numerically-driven behaviors that typically begin at 7 dpf(Adam et al., 2024;Lucon-Xiccato et al., 2023 Casper zebrafish (Danio rerio) expressing a pan-neural, nuclear-localized fluorescence Ca 2+ reporter (elavl3:H2B::jGCaMP7f) was a gift from the lab of David Prober at California Institute of Technology.Larval fish were raised accordingly to establish methods (Avdesh et al., 2012) with modifications: 13:11 hr (light:dark) and fed dry food twice daily after 5 days post-fertilization (dpf).Experiments used zebrafish ranging from 3-7 dpf.Sex is not defined at this stage of development.Larvae were raised in 50 mL petri dishes with approximately 50 larvae per dish.E3 medium (5 mM NaCl, 0.17 mM KCl, 0.33 mM CaCl2, 0.33 mM MgSO4).All animal procedures conformed to the institutional guidelines set by the University of Southern California Department of Animal Research.