Spatial cognition in naturalistic environments, for freely moving animals, may pose quite different constraints from that studied in artificial laboratory settings. Hippocampal place cells indeed look quite different, but almost nothing is known about entorhinal cortex grid cells, in the wild. Simulating our self-organizing adaptation model of grid cell pattern formation, we consider a virtual rat randomly exploring a virtual burrow, with feedforward connectivity from place to grid units and recurrent connectivity between grid units. The virtual burrow was based on those observed by John B. Calhoun, including several chambers and tunnels. Our results indicate that lateral connectivity between grid units may enhance their “gridness” within a limited strength range, but the overall effect of the irregular geometry is to disable long-range and obstruct short-range order. What appears as a smooth continuous attractor in a flat box, kept rigid by recurrent connections, turns into an incoherent motley of unit clusters, flexible or outright unstable.
- spatial cognition
- realistic environments
- grid cells
- place cells
- recurrent connections
The nervous system acquires from experience multiple representations of the external world. Extensively studied examples are in the hippocampus and adjoining cortices of rodents and other small mammals, near the apex of their cortical hierarchy . There, the position of the animal in its immediate surroundings and other spatial variables are clearly prominent correlates of neural activity, as exemplified by 50 years of research on place cells , but high level representations have been described also for other variables, including time [3, 4], auditory frequency , odors [6, 7] and taste . Spatial representations have been thoroughly studied in the laboratory, yielding amazing results  but in conditions rather different from those prevailing in the wild. The medial entorhinal cortex (mEC), one synapse upstream of and a major source of inputs to the hippocampus, includes numerous functionally-defined cell types contributing to spatial representations. Significant fractions of its cells have been characterized as grid cells , border cells , head direction and conjunctive cells , speed cells  and irregular spatial cells . Should we understand this characterization as encompassing the different components of a precisely engineered system, or as a list of some of the most salient properties expressed by this population of neurons, which is however not rigidly partitioned into cell classes? The question is made more relevant by the failure, over the years, to identify a precise correspondence of such putative classes with cell properties observed in other species, notably in primates.
Place cells fire action potentials when the animal moves through locations in the environment, specific to each cell, called place fields. A simple intuitive model envisages place cells as being assigned, at random, each a location in the environment to represent with its activity, so that at a population level from the list of cells active at a moment in time one can easily decode the position of the animal – who effectively, then, has available a spatial map with its own position annotated on it. This model does not seem outrageously inappropriate, particularly given that the majority of place cells show only one field in the classical laboratory environment, typically smaller than . Several recent experiments, however, show that in larger environments place cells often have multiple and irregularly arranged place fields [15, 16, 17, 18]. Still, since the multiple fields are irregularly arranged, one expects that a different list of active cells will uniquely identify each location. Thus place cells, on their own, should effectively represent or map a number of locations in space exponential in the number of cells considered. Even huge environments could be mapped by a sufficient number of place cells.
The effectiveness of the spatial code would appear more doubtful with grid cells, discovered later in the medial entorhinal cortex (mEC) . At least in the simplest intuitive model, each grid cell fires at multiple discrete spaced locations, regularly arranged on a hexagonal pattern that tiles the entire space available to the animal in a laboratory environment. Taken to the extreme, the model would predict that the list of active cells is the same at all locations situated on the hexagonal pattern, which the code would then be unable to distinguish. But are the intuitive models abstracted from experiments in the lab relevant to ecological conditions, where these neural systems have evolved over millions of years?
In this paper, we focus on the pattern formation process of grid cells, based on feed-forward spatial information contributed by place cells, as expressed in our self-organizing adaptation model.
The spatial representations expressed by grid cells and place cells have been reported to differ substantially in the amount of local information they incorporate. Place cells can show global remapping, given sufficient changes in the external environment , indicating that they are highly influenced by local spatial information. Grid cells, at least in flat regular environments, do not show global remapping, once the population as a whole has been
To better understand the spatial selectivity expressed by grid cells, it seems increasingly urgent to move out of artificial laboratory settings. Grid cells have been observed in several species, including rats , mice  and crawling bats , with related cellular selectivity also in monkeys  and humans [31, 32], pointing at some degree of universality underlying the phenomenon. These animals experience space in their natural environment, whether large scale 2D where they roam, or 3D where they swim, jump, climb and fly, or curved and crooked, for those who live in burrows. One could start by considering three simple types of geometry, flat 2D, 3D, and curved.
In this paper, we aim to further our understanding of grid patterns in burrows, where rats, arguably the most frequently used species for the study of spatial representations, usually live in the wild [40, 41].
Norway rats, a most common strain of rats widely used in research, usually referred to as the
2.1 The construction of the burrows
Our computer model generates virtual burrows with a simple geometry, in which the chambers are represented by spheres, of variable diameter, while the tunnels are schematized as sequences of short curved cylinders (i.e. sections of tori) of variable length and external (curvature) radii, and fixed internal diameter – just enough for a virtual rat to run through. Spheres are thus assigned a center and a diameter, while curved cylinders are defined by a circular basis (with a fixed diameter and a centre and normal versor such that it lies on a sphere, or at the end of another tunnel segment) which is then translated along an arc of circumference (with parameters the versor and magnitude of the curvature radius, and the arc length). Additionally, we draw on the work of Calhoun  to define probability distributions for e.g. the diameters of the spheres and the lengths of the tunnels.
Burrow construction proceeds by generating a given number of spheres, with diameters and center-center distances compatible with the observed chamber sizes and distribution of tunnel lengths. Then, the internal burrow connectivity develops, randomly split between chamber-chamber and tunnel-chamber tunnels. Finally, some blind and exit tunnels are added.
The tunnels start with an existing object - sphere or tunnel - and define the initial segment of the new tunnel as a short, straight cylinder with the basis circumference tangent to the preexisting object at a random location, then new curved segments are added, with a basis that coincides with the top of the previous one (same centre, radius and normal versor), while the remaining parameters are randomly generated. The tunnels terminate after randomly growing in random directions for a random length if blind tunnels, when penetrating a target sphere or tunnel if internuncial tunnels, or upon reaching a predefined horizontal plane (i.e. the ground) if exit tunnels. In the last two cases, the direction of growth is biased towards the target destination, with a probability inversely proportional to the distance to the target, and we restrict the choice of the plane of the radial curvature so as to point towards the desired outcome.
In the simulations, a virtual rat explores one of the virtual burrows described above with a constant speed . Each time step in the simulation is taken to correspond to in real time. The total length of a simulation is 100 million steps (which would correspond to nearly 12 days of continuous running, to ensure that the self-organization process has approached its asymptote). To obtain smooth random trajectories, resembling those observed in experiments, the change in running direction in the chambers is sampled from a Gaussian distribution with zero mean and standard deviation radians; in tunnels, since the size of the tunnels normally can only allow a single rat to pass, the running direction of the virtual rat is always following the tunnels. If the random trajectories lead the virtual rat to the junctions, the virtual rat changes sub-environment (from chamber to tunnel, from tunnel to chamber, or from tunnel to another tunnel). If the tunnel has a dead end, the virtual rat turns back when it reaches the end. The trajectories are limited to the lower half of the environment because of gravity.
2.3 Network model
The model is comprised of two layers. The input layer represents, for example, the CA1 region of the hippocampus and contains model place cells, which we refer to as
The input to grid unit at time is given by
The weight connects place unit to grid unit
Here we assume that grid units develop their maps from scratch, receiving spatially modulated inputs from the place units which have already developed, in line with observations in rat pups, which show that place cells mature earlier than grid cells [42, 43].
Although weak spatial input is sufficient for grid pattern formation , regularly arranged place cells are ideal for this function and reduce the averaging necessary for learning with respect to more irregular inputs. Here the activity of each place input unit in space is modeled as a Gaussian place field centered at preferred position
where is the current location of the virtual rat. is the shortest distance (distances in chambers are calculated along great circles, and in tunnels longitudinally, adding them up if and are not in the same sub-environment). is the radius of the place fields.
2.3.1 Single-unit dynamics
The firing rate of grid unit is determined through a threshold-nonlinear transfer function
where normalizes the firing rate into arbitrary units. is the Heaviside function. The variable is a threshold while represents a time-integration of the input , adapted by the dynamical threshold
where has slower dynamics than , and is set to , . These adaptive dynamics make it more difficult for a neuron to fire for a long period of time, and endow grid units with fatigue dynamics . The gain and threshold are iteratively adjusted at every time step to fix the mean activity and the sparsity within a relative error bound from pre-specified values, and respectively.
2.3.2 Head direction modulation and collateral connections
Head direction (HD) modulation and collateral connections are important for grid alignment, as suggested by the detailed analysis in [33, 34]. The head direction in the chambers (spheres) is defined as the angle between a vector and the vector pointing towards the north pole.
With the addition of HD modulation and collateral connections, Eq. (1) for the inputs to grid unit is rewritten
where is the activity of other grid unit reverberated by collateral connections with a delay steps. when and when , where for each simulation, and is a set value controlling the strength of recurrent connections. Then the time-dependent strength is gradually increasing from zero, in order to reduce the influence of the initial random weights.
is the HD tuning function that has maximal value when the current head direction of the simulated rat is along the preferred direction .
and and are parameters determining the baseline activity and the width of head direction tuning.
2.3.3 Synaptic plasticity
All weights in the network self-organize while the virtual rat explores the environment and the updating following the Hebbian rule.
Weights between place units and grid units are changed according to
where when and when , here , . and are estimated mean firing rates.
and is a positive averaging factor.
The collateral weights between grid units are adapted according to
Here is a learning rate smaller, at least initially, than the learning rate for feed-forward weights between place units and grid units. is an inhibition factor.
All the weights in the network are initialized as random numbers , and is a random variable uniformly distributed in .
After initialization or weight changes, all weights are normalized to a unitary norm
In the simulations, grid units may have been expected to form highly regular patterns, as they do in flat 2D environments . However, in our burrows, modeling the natural environment of real rats, the activity patterns that get established are not nearly as regular. Figure 2 shows the grid map of one sample grid unit. The lower half of the sphere, representing a chamber, was projected to a horizontal plane, while the upper half was discarded, as trajectories are limited to the lower half to model gravity. Tunnels were straightened into 1D segments. Sufficiently explored chambers show clearly identifiable fields, while those where the virtual rat spent less time show only blurred, often overlapping fields. Longer simulations make for little improvement. Tunnels, as they are 1D structures, are easier to learn and show clear fields even in shorter simulations.
The grid maps in a chamber include very few fields, as indicated in Figure 2 top. In fact, chamber width is at most 0.3 m (reported as 298 mm, with median 221 mm and minimum 155 mm ), unlike the 2 m diameter of the flat circular enclosure used in the Moser lab , and even considerably smaller than the small square boxes used earlier and in several later studies (e.g., ). Due to this reason, to be able to study the layout of the fields in a spherical chamber we have used larger diameters in our model curved environments, so they would include e.g. the 12 fields of the most regular pentagonal arrangement [37, 39] (on the entire sphere, top and bottom, with 6 in the lower half).
For grid patterns to be stable, the feed-forward learning rate between place units and grid units has to be very small. As shown in Figure 2 bottom, with learning rate grid units may keep shifting their fields as the simulation proceeds, so that their correlation with those at any reference time keeps changing; with learning rate the stability is markedly improved, and with grid units appear to form stable maps both in chambers and in tunnels.
The gridness score has been widely used to quantify the spatial periodicity of grid patterns, but it can be applied only to patterns with six-fold symmetry. Results from simulations in curved environments show regular grid patterns with five-fold or lower symmetry for constant positive curvature, and seven-fold or higher symmetry for negative curvature [37, 38]. In the burrows simulated here, inter-field distances vary also within chambers (light blue distribution in Figure 3 top), indicating that spatial periodicity is not a property of grid cells in natural environments.
The inter field distances in tunnels (green distribution in Figure 3 top) have a larger peak value than in chambers. In chambers, in fact, our simulated trajectories are curved as the running direction keeps changing, unlike the trajectories in tunnels which can only follow the 1D tunnels, so the distance traveled over the adaptation time scale is longer in tunnels than in chambers. For real rats, of course, the distance traveled in each sub environment depends strongly on their prevailing speed, likely contributing to the different representation of grid cells in tunnels and chambers.
The virtual rat learns the entire environment at the same time, since the randomly generated trajectories span it all. We asked, then, whether grid units form a continuous representation of the whole environment, by checking whether the junctions connecting chambers and tunnels break the continuity. In Figure 3 bottom left, field B and field A are the closest fields to a junction, from the tunnel and chamber side, respectively, and and represent their distance from the junction, so that . As shown in Figure 3 bottom right, and do not show the expected negative correlation (with or with any other clear slope), but rather a loose relationship. This indicates that spatial representations by simulated grid units are effectively independent in distinct portions of the environment, as this is in practice partitioned up by the junctions.
Realistic simulated burrows like that in Figure 1 right require enormous CPU time to be explored with sufficient statistics, and even then the maps that form especially in the chambers often present rather unclear fields, as in Figure 2. Therefore, in the following analyses we consider a
The inter-field distance distribution in the box environment (of size ) has clear peaks, shown in Figure 4 upper left. The fourth and fifth peaks are shifted to the left compared with those of perfectly regular six-fold grids, probably because the virtual trajectories are limited by the hard border (which reflects the trajectory as in a mirror when it hits the border). The angles have a distribution centered at 60 degrees, shown in Figure 4 upper right.
The spherical environment, with radius , allows most grid units to develop 12 fields. Their distribution of field distances also has clear peaks (Figure 4 center left). The angle distribution is centered at degrees (Figure 4 center right), just degrees below the degrees value of the perfectly regular five-fold grid pattern.
In the burrow environment, simulations have parameters consistent with those in the sphere. The field distance distribution does not have clear peaks, however (Figure 4 lower left). The angle distribution shows more variability than in the box and in the sphere (Figure 4 lower right). This suggests that the formation of regular grid patterns in natural environments, like rat burrows, is very challenging for the same system that produces them easily in laboratory conditions.
The grid maps of cells recorded at the same electrode position show generally a small correlation or rather an anti-correlation , because even with similar grid spacing and orientation, a relative phase shift between cells is sufficient to remove the correlation between them. The results from simulations in the flat box environment point at the same phenomenon, with in fact most pairs of grid units ending up negatively correlated, as shown in Figure 6 top. Away from six-fold symmetry, however, things are a bit different. In the sphere, units can form five-fold symmetric grid patterns, when they have 12 fields, fields which
Both in the box and sphere environments, the correlation between
Local recurrent connections have been identified as a key element of grid pattern formation , in particular to align the grids in a flat environment [35, 46, 47]. We asked how the strength of recurrent connections affects the pattern formation process in our model environments. We simulated the adaptation model in flat and curved environments, and took the standard deviation of the angles from local triangles as a measure of the regularity of the grid pattern.
Considering two flat environments, a square box and a trapezoid with the same area, grid patterns show minimal standard deviation in the square box when the strength of recurrent connections takes a specific value , as shown in Figure 5; and a larger minimum value (Figure 5) for somewhat weaker recurrent connections () in the trapezoid, known to distort the grid pattern of real cells .
In the sphere, however, the minimum standard deviation, comparable with that in the box environment (as both allow for regular tessellation, five-fold in one case and six-fold in the other), is reached with much weaker recurrent connections, , as shown in Figure 5. In even the simplified burrow, the standard deviation of the angle distribution is inherently higher, because of the lack of long-range order even in the absence of recurrent connections, and recurrent connections are bound to increase the irregularity further (see Figure 4 lower left).
In general, the strength of the recurrent connections might contribute to the rigidity of the grid pattern across environments, but also perhaps to its flexibility in the interaction with walls , changes in the boundary  and the appearance of local cues , including goals .
The structure of the natural habitat of any species would appear to be a prime determinant of exactly how that species has adapted to live in that habitat; yet in exploring the spatial memory and navigation abilities in rodents, and in particular the neural systems that subserve them, early experiments have focused on artificial laboratory environments, incongruent with those prevailing in the wild. The discovery of the remarkable spatial selectivity of grid cells, evident in such laboratory set-ups, has raised the issue of what grid cell firing patterns would look like, in an ecological setting.
More recent experiments have pointed at increased irregularity and plasticity of grid activity patterns, whether due to large environments , non-standard shapes , modulation by local cues , boundary changes  or the presence of goals . These observations, however, were largely framed as deviations or perturbations from the ideal notion of a regular tessellation of the environment, exhibiting long-range order
The possibility that long-range order may not apply at all in an ecological setting was raised initially by looking at the activation patterns that emerge, with the adaptation model, in 3D  or on curved 2D surfaces [37, 38], and is confirmed in a long-running experimental study in bats . While bats fly, rats are burrowing animals, and natural burrows are much more complicate structures than open arenas or other schematic laboratory settings.
In the present study, we have modeled the burrow environment based on the detailed quantitative descriptions by John B. Calhoun, and we have let a virtual rat randomly explore it; then using our self-organizing adaptation model we have observed grid pattern formation in model units. Grid units can attain stable representation of the whole environment, if acquiring it slowly, but less explored sub environments tend to be represented by blurred maps. The limited size of the chambers in natural burrows only allows grid units to express very few fields, challenging the very idea that grid cells may show long-range order outside the lab. One may wonder whether the reports of a six-fold symmetry in imaging data from humans, a putative signature of an underlying grid-like representation, might be due to large virtual arenas used in those studies . It comes as no surprise, then, that the characteristic signature was not observed in the limited and non-flat vowel space , although of course there may be many other reasons for a null result.
The continuity of spatial representations depends on the exploration. In , with a multi-compartment environment, real grid cells firing patterns could establish a single, continuous representation that spanned both compartments after prolonged experience. In natural burrows however, tunnels are so narrow that they are effectively 1D structures, and as such they necessarily break any potential continuity in the representation of the chambers. What is left, at least when studied with the adaptation model, is effectively a representation in terms of disjoint spatial
The fragmentary nature of these spatial representations finds expression also at the level of neural populations. Compared with simulations in regular environments (in the square box, but also to some extent in the large hemi-sphere which can accommodate 6 fields), grid units simulated in burrows have more of a tendency to cluster in groups with similar fields. This might be part of the drive that leads to the observed
In flat environments recurrent connections promote regularity (and can align out-of-spatial-phase patterns). In simple environments with constant non-zero curvature, recurrent connections promote irregularity . In real-life environments, it is likely that they cause both irregularity and clustering into groups of units with similar selectivity, running against the principle of representing space evenly, expressed in the most idealized conceptual model by the notion of a continuous attractor.
Experiments in artificial laboratory settings, which utilize well-controlled and simplified paradigms, thus gave us the opportunity to admire a most impressive feat of the rodent nervous system, its ability to approximate a regular tiling of an infinite plane. While an exhilarating experience, this may have distracted us from understanding the characteristics of grid cells in ecological conditions, and possibly their function in an evolutionary perspective.