Improving Neural Predictivity in the Visual Cortex with Gated Recurrent Connections
Abstract
Computational models of vision have traditionally been developed in a bottom-up fashion, by hierarchically composing a series of straightforward operations - i.e. convolution and pooling.
The aim was to emulate simple and complex cells in the visual cortex and resulted in the introduction of deep convolutional neural networks (CNNs).
Nevertheless, evidence obtained with recent neuronal recording techniques suggests that the nature of the computations carried out in the ventral visual stream is not completely captured by current deep CNN models.
To fill the gap between the ventral visual stream and deep models, several benchmarks have been designed and organized into the Brain-Score platform, granting a way to perform multi-layer (V1, V2, V4, IT) and behavioral comparisons between the two counterparts.
In our work, we shift the focus to architectures that take into account lateral recurrent connections, a ubiquitous feature of the ventral visual stream, to devise adaptive receptive fields.
Through recurrent connections, the input’s long-range spatial dependencies can be captured in a local multi-step fashion and, as introduced with Gated Recurrent CNNs (GRCNN), the unbounded expansion of the neuron’s receptive fields can be modulated through the use of gates.
To increase the robustness of our approach and the biological fidelity of the activations, we employ specific data augmentation techniques in line with several of the scoring benchmarks.
We find that forcing some form of invariance, through heuristics, resulted in better neural predictivity.
Introduction
As suggested by abundant physiological evidence, recurrent circuits are ubiquitous in the visual cortex [1, 2, 3] and in several areas of the mammalian brain [4].
In visual layers, the effect of lateral recurrent connections is believed to contribute to receptive fields adaptation [5, 6, 7, 8].
More generally, there are many indications of the capability of the brain to modulate the processing of visual signals on the basis of their context [9, 10, 11].
Classical CNNs, despite showing many similarities with the ventral visual stream, lack the ability of context modulation.
Trying to incorporate recurrent connections in a
CNN architecture poses a problem because standard Recurrent Neural Networks (RNNs) are designed to process time varying sequences of inputs, while computer vision models deal with static inputs.
To both circumvent this limit and try to design a more biologically plausible architecture, the basic idea is to introduce a form of recursion across neurons of the same layer.
In this way it is possible to avoid the problem of static inputs, but still give to each neuron in a layer information about the activity of the surrounding neurons, allowing them to receive information about a larger part of the image.
Similar solutions have been proposed in different forms by many authors, often with the aim of better simulating the visual system [12, 3, 13].
It is worth noticing that the computational graphs of these models, when unfolded in time, look like pure feedforward hierarchies of operations enriched with a number of skip connections.
This results in architectures that are very similar to residual networks [14].
To achieve even better biological adherence, it is useful to add gates in between the recursive computations, as proposed by [15].
In this way the neurons’ receptive fields are explicitly modeled and modulated by the gates.
Model
The introduction of gates is a distinctive feature of GRCNN and is motivated in [15].
The role of gates can be intuitively and qualitatively understood as an extra layer of computation resembling an attention mechanism [16].
Gates are designed to give an output between 0 and 1 that multiplies (pointwise) the activations in the recurrent convolutional layer.
This means that, during training, the set of weights associated with each gate evolves in such a way as to give the network the capability to notice which parts of the image are relevant.
In more detail, a GRCNN is composed by a feedforward sequence of blocks called gated recurrent convolutional layers (GRCL).
Every GRCL block computes a recursion on its inputs, and, between each recurrent operation, the gate system modulates the effective amount of forwarded information - see Figure 1 Bottom .
The equations describing the computations inside the GRCL are the following:
[Equation]
where u is the input, A t , B t , C are convolutional operators with nonlinear activation functions (ReLU) and batch normalization, σ is the logistic sigmoid function and ⊙ is the Hadamard product (elementwise multiplication operator).
We emphasize the variables x t and g t which represent respectively the recurrent state variables and gate activations.
The third equation clearly shows how the absence of gates would lead GRCL to be a standard ResNet T .
The complete model architecture is obtained by stacking two initial convolutional blocks, four GRCLs with T = 3 , and a final readout unit (see Figure 1 Top ).
The architecture’s number of parameters is comparable with ResNet50.
For further technical details, we refer the reader to the original GRCNN paper [15].
Augmentation & Regularization
One of the main limitations in devising a deep model that predicts the neural activity of the ventral visual stream is the training procedure.
Usually, vision models are trained on the ImageNet dataset [17], which in its original formulation is related to a multiclass classification problem.
On the other side, Brain-Score’s benchmarks include several tasks [18, 19] which are not necessarily related to classification.
In our work, we try to alleviate this problem by employing and designing augmentation and regularization strategies, inspired by some of the evaluation benchmarks.
In particular, given their importance in the overall scoring, we decided to focus on behavior - more details can be found in [20] -, V1 and V2 tasks based on [21].
Given the spirit of the behavioral benchmark, we took advantage of CutMix [22], an augmentation strategy that facilitates the recognition of different objects from partial views in a single image.
More specifically, in CutMix, patches are cut and pasted among training images while, at the same time, the corresponding labels are linearly combined, resulting in: ˜ x
= M ⊙ x
A + ( 1 − M ) ⊙ x B and ˜ y
= λy
A + (1 − λ ) y B , where M ∈ { 0 , 1 } W × H denotes a binary mask indicating where to drop out and fill in from two images, 1 is a binary mask filled with ones and λ is sampled from the uniform distribution U (0 , 1) .
In parallel, to enhance the robustness of learned representations, we employed AugMix [23], which allows our model to explore the semantically equivalent input space around an image.
Briefly,
AugMix consists in combining simple augmentation operations - e.g. translation, rotation, sheartogether with a consistency loss.
Augmentations are sampled stochastically and concatenated while a consistent embedding around the input image is enforced by using the Jensen-Shannon divergence as a loss.
Lastly, we introduced a regularization term in a similar vein to [24], with the idea that behavioral traits cannot be fully described in terms of a scalar metric - e.g. accuracy - but need to be conceived in terms of higher-order descriptors such as reconstructing a confusion matrix, in order to force a network to fail in the same way as a primate would.
We took as a reference human performances on 11 superclasses (i.e. groups of classes) of ImageNet [25], projected down the predictions of our model - 1000 dimensional vector - onto the 11 superclasses and imposed an additional cross entropy loss on this term, to quantify the distance between our model and human performances.
To improve scores on V1 and V2 benchmarks, we opted for an augmentation technique largely inspired by [21].
Given that V2 neurons are particularly sensible to textures while V1 neurons respond in a similar way to a texture and its phase randomized counterpart, we considered a texture dataset composed of images coming from the following [26, 27, 28], and we extended it by generating each texture’s phase randomized counterpart, named noise 1 .
After that, we fine-tuned our model’s first GRCL block - roughly corresponding to V1 - by freezing all the other layers and randomly blending input images separately with textures and noise.
Later on, we fine-tuned the second GRCL block in the same way, but by only blending input images with textures.
In this way we tried to emulate how specific layers in the visual cortex respond to different stimuli, and we got improvements in both V1 and V2 with respect to the baseline.
Results and conclusions
Introducing receptive fields modulation through a gated recurrent mechanism is beneficial in terms of neural predictivity in the visual cortex.
The baseline GRCNN model shows promising results in several benchmarks.
As shown in table 1, by introducing the previously mentioned regularization and augmentation techniques, scores improve on specific benchmarks, as well as on average.
In the current state, further work is needed to get a better sense of such preliminary results 2 .
In this regard, we have implemented several variants of the baseline model, including an integration of the VOneBlock [29] as a substitute of the first convolutional block in the GRCNN.
With more computational power we are planning to train this combined architecture from scratch.
Ultimately, another interesting perspective for further exploration is related to how CNNs learn textures and not shapes [30], which is ultimately analogous to our augmentation strategy for V1 and V2.
Acknowledgment
All the authors wish to show their appreciation to MLJC 3 for providing them with the essential computational power (Nvidia RTX 2080 Ti) for finetuning their models.
S.A. would like to thank
Arianna Di Bernardo and Sophie Bagur for useful and constructive discussions as well as COSYNE 2022 organizers for providing him with a Travel Grant to take part in the conference.
S.P. would like to thank ISI Foundation 4 for the hospitality while performing this work and for the computational resources, the Centre of Informatics Tricity Academic Supercomputer Network in Gdansk for additional computational resources, Giovanni Petri and Karolina Finc for the kind supervision, and
Alan Perotti, Maxime Lucas, Antonio Leitao for the helpful discussions.
S.P. would also like to thank the Polish National Science Foundation grant UMO-2016/20/W/NZ4/00354 for partially funding this work.