Spontaneous discrimination takes advantage of ecological and naturalistic setups to investigate quantity discrimination abilities. However, the limitations of this method are apparent, and concern factors such as lack of motivation and difficulty in stimulus control. Discriminative failure may be driven by a lack of motivation, especially when the discrimination involves large numerosities: it is important for animals to maximize the intake strategy when dealing with few items (according to the optimal foraging theory; 
), but it might not be so relevant when dealing with large numerosities, when both amounts would offer enough energy.
Another issue is related to the difficulty in controlling continuous physical variables that co-vary with numerosity using naturalistic stimuli. Some cues are not easily controllable (e.g., when using social stimuli, the overall movement and the volume of the conspecifics is hard to be taken into account). Besides, the control of some variables does not exclude possible side effects that may influence spontaneous preference, e.g., larger pieces of food may elicit higher attraction 
Some of these issues may be more easily overwhelmed using artificial and well-controlled stimuli combined with operant procedures. Typically, in training procedures animals are requested to discriminate between different sets of elements with different numerosity by choosing the one associated with a reward (usually food). Differently from spontaneous choice, using discrimination learning procedures it is possible to keep the animal’ motivation high irrespective of the numerosities presented, allowing experimenters to accurately test the actual discriminative limits of the animals’ numerical competence. Agrillo et al. 
trained mosquitofish (Gambusia holbrooki
) to discriminate between sets of visual elements (2 vs. 3) and choose the one associated with a reward (i.e., social reward). Mosquitofish proved able to discriminate between the two sets, showing however a drop of performance when either the cumulative surface area or the overall space occupied by the elements was equalized 
. Similar results were obtained when mosquitofish were trained with large numerosities (higher than four elements; 
), suggesting that some physical properties are spontaneously used in the learning discrimination process by fish. However, no discrimination impairment was noticed when non-numerical physical cues were simultaneously controlled for during the training 
In order to check whether processing numerosity would be more cognitively demanding than processing of continuous quantities (and thus used as a “last resort” strategy, see 
), mosquitofish were trained in a 2 vs. 3 discrimination by making available either only continuous variables or only numerical information, or both simultaneously. Fish improved their performance when both numerical and physical information positively correlated than when only one of the two information were differing. However, no difference was found between the two latter conditions, suggesting that numerical information is not more cognitively demanding than other types of information 
The influence of non-numerical variables has been recently investigated in archerfish (Toxotes
sp.). In a magnitude discrimination task between two groups of dots differing in number, archerfish showed that choice for sets with more/less dots was mainly modulated by non-numerical magnitudes (i.e., overall surface, overall perimeter, density, convex hull, average diameter) that positively correlated with number. Fish tended to select the group containing the larger non-numerical magnitudes and smaller quantities of dots, choosing the larger group of dots only when it was positively correlating with all non-numerical magnitudes 
Recent evidence suggests that zebrafish learning performance is strongly influenced by stimulus conspicuosness 
. Similarly, guppies’ numerical ability is improved when the stimulus saliency is enhanced by the presence of moving targets 
and is worsened using an automatic conditioning chamber compared to that observed in more naturalistic settings 
. It is therefore important to take into account that different methods may work well for one species but not for others, and that differences in performance may be related to procedural differences rather than cognitive limitations.
Quantitative abilities have been demonstrated in blind cavefish (Phreatchthys andruzzii
trained to discriminate groups of sticks differing in numerosity in a circular thank subdivided in eight equal sectors. The experiment showed that, using the organs of lateral lines, blind cavefish proved able to discriminate between 2 vs. 4 objects when both numerical information and continuous quantities were simultaneously available, with a drop of performance when presented with stimuli controlled for continuous quantities. However, if trained from the beginning only with stimuli controlled for non-numerical quantities, cavefish proved able to learn the discrimination relying solely on numerical information.
Overall, it appears that fish numerical performances are comparable to those of mammals , birds , amphibians , reptiles  and invertebrates such as bees , although discrimination accuracy is often lower than in other species such as primates  and parrots . In these latter cases, however, animals are usually trained for a massive number of trials (thousands of trials), while fish training is usually limited to less than 100 trials. In fish, extensive training can increase numerical performance accuracy as seen in guppy  and goldfish . Goldfish can achieve high accuracy levels (>90% correct) when exposed to extensive training (approximately 1200 trials), with performances similar to those of birds  and primates .
The ability of fish to assess quantity (magnitude) in the continuous domain has been widely studied in zebrafish (see Figure 1).
Neill and Smith 
investigated the ability of large populations of zebrafish larval tectal neurons to respond selectively to the size of visual stimuli. They reported that size selectivity was established earlier during development of zebrafish larvae starting from 72 h post fertilization (hpf) for large stimuli and 78 hpf for the small ones, with a perception of magnitude sensitivity and selectivity that improves with the maturation of retinal and tectal dendrites and connectivity (from 84 hpf to 9 dpf; 
). Following the evidence that vertebrate retina contains distinct populations of retinal ganglion cells sensitive to object size 
, Preuss et al. 
studied distinct populations of tectal neurons involved in the discrimination between small- and large-size objects. Using calcium imaging of retinal ganglion cells (RGC) afferents to optic tectum and artificial stimuli which were previously shown to evoke different swimming patterns 
, they showed that RGC afferents and tectal superficial interneurons arborize in distinct retinorecipient layers of the tectal neuropil playing a critical role in object size classification 
. It was suggested that small-size-selective retinal inputs would arrive at superficial layers of tectal neuropil while large-size-selective ones to deeper layers connecting the size-based categorization of visual targets to the role played by the tectum in approach/avoidance behaviors 
. Barker and Baier 
, combining optogenetics, imaging and single-cell reconstructions, identify specific interneurons in the optic tectum that are tuned to object size, influenced by prey-selective RGCs inputs and thus guiding behavioral choice (approach or avoidance). Finally, Helmbrecht and colleagues 
extended this research by identifying how the segregation of the outputs generated by the receptive fields is converted into a visual-motor response processed by premotor nuclei located in the hindbrain of zebrafish larva.
Habituation/dishabituation experiments associated with measurements of early gene (IEGs) expression were performed on adult zebrafish by Messina et al. 
. Animals were first habituated to a set of stimuli (small dots) and then faced (dishabituation) to a similar stimulus with a change in size (threefold increased or decreased). A selective change in the expression of the immediate early genes c-fos and egr-1 in retinal and optic tectum tissues with respect to a group facing the familiar control stimulus was observed 
. Overall, these findings indicate a conservative role of retina and optic tectum in the elaboration of continuous quantities in embryonic and adult zebrafish.
5. Neural Correlates of a Sense of Discrete Magnitude (Number) in Zebrafish
Recently, zebrafish studies have expanded our knowledge about the neural correlates of quantity estimation to discrete quantities (numerosity) (see Figure 2).
Figure 2. Neural correlates of numerosity cognition in zebrafish. (A) Possible timeline of development of number sense in zebrafish. (B) Schematic representation of telencephalic and thalamic nuclei activated upon a change in visual numerosity in zebrafish adult brain. (C) Molecular biology analyses revealed that the caudal region of central part of the area dorsalis telencephali (Dc) responds to change in numerosity of visual stimuli in adult zebrafish brain.