This post is about F-BNet, a model I built in 2023 that predicts brain responses to photographs. The brain responses are fMRI, which measures blood flow across the brain while a person lies in a scanner, and here the person is looking at pictures of natural scenes. A model that takes the picture and predicts the scan is called an encoding model.
Building one is usually one big regression. A regression takes a list of numbers that describe the input and a list of numbers that were measured, and finds a weight for every pair of input number and measured number, so that the weighted sums of the input come as close as possible to the measurements. Fitting the regression means choosing those weights from examples where both lists are known. Here the input numbers describe the picture and the measured numbers are the scan.
Both sides of that regression are large, and both need unpacking. On the input side is a vision model, a neural network that has already been trained on millions of ordinary photographs to tell what is in them. Run a picture through it and its last layer holds thousands of numbers, each one saying how strongly some pattern the network learned to look for is present in that picture. Those numbers are the features, and they are what the regression reads.
On the output side is the cortex, the folded outer sheet of the brain. The scanner stores that sheet as a mesh of many thousand points, the same way a 3D model of a face is a mesh of points, and each point is a vertex. One hemisphere of visual cortex has about twenty thousand of them. At each vertex the scan gives one number per picture, how strongly that small patch of brain responded to it.
The map from one side to the other has to be learned from the pairs of image and response that exist for one person, and there are not many of those. A layer that reads every feature and writes every vertex has one adjustable weight per feature and vertex pair, which is far more weights than there are brain-labelled images to fit them on.
The usual answer is to fine-tune the whole vision model against the full response and let regularisation sort it out. Fine-tuning means taking a network that was already trained on one job and continuing to train it on a new one, so the weights it arrived with are nudged rather than learned from scratch. Here the vision model that learned to recognise photographs is nudged until its output predicts the scan.
Regularisation is a penalty added during training that grows with the size of the weights. With far more weights than examples, a fit can match the examples by chasing their noise, and the penalty makes that expensive, so the weights stay small unless the data insists. It is a brake, and the fit that comes out depends on how hard the brake is set.
That is slow, and it hides the geometry of what was fit. I wanted to know whether the map could be learned between two small flat pieces of each space instead, one chosen from the images and one chosen from the measured responses, with everything outside them left alone. A flat piece here means a line, a plane, or the same thing with more directions, passing through the middle of the data. I will call those flat pieces subspaces.
The model that came out of that is F-BNet. It squeezes the image features down to 300 coordinates and each hemisphere's response down to 75, learns a small neural network between them, and uses the same axes to turn the network's 75 outputs back into a full hemisphere. The image features come from CLIP ViT-B/32, a vision model from OpenAI trained to match pictures with their captions. On the Algonauts 2023 evaluation of the Natural Scenes Dataset, a public benchmark for predicting brain responses to natural scenes, F-BNet scored 46.27 where a CLIP ViT-B/32 fine-tuned end to end scored 41.41, and ten passes over the training data took 43 seconds instead of 403.
The bottleneck is also a statement about the map and not only a compression trick. This post goes through the construction, the three exact things it proves, and what it leaves open.
The size of the direct map
CLIP writes an image as one number per feature, and I collect those numbers as the vector . Taking the model's last internal layer of activity for the image and flattening it into one list gives . A hemisphere of visual cortex is a vector with one entry per vertex, for the left and for the right. For the participant drawn in the figures below, and . The direct model learns
Even a single linear layer of that shape, one matrix of weights multiplying the features, has weights. With these numbers that is about 1.5 billion, and the number of images one person has looked at in the scanner is nowhere near that. The fine-tuned baseline I compare against is this problem solved the usual way. The vision model is trained per participant against the full response, in the original vertex space, and the regulariser carries the mismatch.
Principal component analysis
Some maths now, though I will keep it to geometry you can draw. The tool I use to shrink both sides is principal component analysis, PCA, and I want to describe it as geometry before using it. Take response vectors in and their mean . Each vector is a point in a space with one axis per vertex, so the data is a cloud of points, one per image. Karl Pearson asked in 1901 which flat with directions through the cloud lies closest to, where a flat is a line, a plane or the same thing with more directions, and closeness is the sum of squared perpendicular distances from each point to the flat.
The answer comes from the covariance of the cloud, and covariance and eigenvectors both need unpacking. The variance of the cloud along one direction is the average squared distance of the points from the mean along that direction, so it measures how far the cloud spreads that way. The covariance matrix records that spread for every vertex and, for every pair of vertices, how much the two rise and fall together across the images. Two vertices that always respond together have a large entry, and two that have nothing to do with each other have an entry near zero.
Picture the cloud as a rugby ball. Its longest axis is the direction along which the points spread most, the next is the direction at right angles to it with the most remaining spread, and so on. Those axes are the eigenvectors of the covariance matrix, and the spread along each one is the matching eigenvalue. The flat of closest fit is spanned by the top of them, and it is also the flat that keeps as much of the cloud's variance as any flat with directions can. Stack those eigenvectors as the columns of .
Two facts about carry the rest of the post. The columns are orthonormal, so each has unit length and any two are at right angles, which is . And the matrix is the orthogonal projector onto the flat, the matrix that drops each point perpendicularly onto it. It is symmetric, and , so applying it twice is the same as applying it once, which is what a projector has to satisfy.
Dropping a perpendicular from a point onto the flat lands at . The numbers say where that foot sits in the flat's own coordinates. So reading with compresses, and reconstructs by placing the foot back in . Everything in the perpendicular direction is lost, and that loss is the price of the bottleneck. It gets an exact accounting below.
Two projections
I do this three times, once for the image features and once per hemisphere,
and move every vector into its coordinates.
The trainable network only ever sees the small vectors,
and the bases write its output back into the vertex spaces.
In the experiments and . The image goes from roughly 37,800 numbers to 300, each hemisphere from roughly 20,000 vertices to 75, and the only thing that trains is the map between 300 numbers and 150. I will call the 150 numbers inside the bottleneck the latent coordinates, latent because nobody measures them directly. CLIP stays frozen, meaning none of its weights change during training. That separates the question of how images map to cortex from the question of how to learn visual features in the first place, and it takes most of the trainable parameters off the table.
During development I also tried adding captions to the image representation, written by BLIP, a vision-language model that can write a sentence describing an image. The improvement was not consistent enough to pay for the extra compute, so it is not in the model.
The network itself is small. A dense layer that widens the 300 coordinates, where dense means every input connects to every output through its own weight, then one linear residual block with a parametrised ReLU, dropout of 0.2, and two output layers of 75 numbers each, one per hemisphere.
Three of those words need unpacking. A residual block adds its input to its output, so the block only has to learn a correction to what it was given rather than a whole new representation. A ReLU is a unit that passes positive values through and sets negative ones to zero, and a parametrised ReLU learns a small slope on the negative side instead of fixing it at zero. Dropout of 0.2 switches off a random fifth of the units on every training step, so the network cannot lean on any single one.
Each basis is fit on its own data alone. The image basis is fit on the CLIP features and each response basis on that hemisphere's measurements, so neither subspace knows anything about the pairing between images and responses. The pairing is left entirely to .
The retained subspace
The reconstruction step is not a compression trick on the output. It is a constraint. For hemisphere write the retained response subspace as
where col of a matrix means its column space, the set of every vector you can make by combining its columns. Every prediction satisfies , because is a combination of the columns of whatever is. Whatever the network does, the cortical pattern it produces lies in a fixed flat of 75 directions inside a space with about 20,000 axes, one per vertex.
I should be precise about what kind of object is. A subspace is the flat itself, the set of all points you can reach inside it. A basis is a set of directions chosen as coordinate axes for it, the way north and east are a basis for a map, and north-east and north-west would be another basis for the same map. The same flat of 75 directions can be described by any 75 orthonormal vectors that span it, and the set of all such descriptions is , which is every rotation and reflection of the original PCA axes inside the flat.
The Grassmannian is the set of all subspaces with directions inside . It is what you get when you agree to treat all those bases as one point. So , and the PCA axes are one coordinate system on that point. The question is whether the model depends on the point or on the coordinates.
Proposition 1. Let be orthogonal, , so that it rotates or reflects the 75 axes without stretching anything. Define and . Then .
Proof. Since , .
So an orthogonal change of latent coordinates leaves the reconstructed response alone, once the predictor is changed to match. A network that outputs instead of is the same model in the only space anyone measures. The subspace is the stable object. The orientation of the PCA coordinates inside it is a choice of description, and nothing about the brain should be read off those axes.
The proposition gives a clean split. The model's claim is the point on the Grassmannian, and everything about the individual latent coordinates is convention.
The error decomposition
Let be the measured response with its mean removed. Because is the orthogonal projector onto , the identity splits it into the foot of the perpendicular and the perpendicular itself. The two pieces are orthogonal, and the check is one line. For any and ,
using . The first piece is what the bottleneck can represent. The second is thrown away by truncation, and no choice of can reach it.
Proposition 2. For any latent prediction ,
The double bars with the subscript 2 mean the ordinary length of a vector, so each term is a squared length.
Proof. With and ,
The two terms are orthogonal by the line above, so the squared lengths add by Pythagoras, and because has orthonormal columns.
The first term is latent prediction error, and training moves it. The second is subspace truncation error, and it is fixed the moment is chosen. No predictor touches it.
This is the trade I kept running into during development, and the proposition is why it is a trade and not a tuning accident. Raising shrinks the truncation term, because a bigger flat lies closer to every point in the cloud. But it also makes the latent problem harder, because there are more coordinates to predict from the same images. Lowering does the opposite. 75 is where that trade settled on this data, so it is an operating point and not a measurement of how many dimensions visual cortex has.
The rank bound
Put the pieces together and the full map for hemisphere is
Start with the case where the bottleneck network is linear, with . Then . Seen from the original image and vertex spaces, the model is one matrix
The rank of a matrix is the number of independent directions it can output. The rank of a product is at most the rank of any factor, and has only 75 rows, so the whole matrix has rank at most 75.
The picture is that first reads the image through 300 directions and ignores everything orthogonal to them, then mixes those readings, then writes the result along 75 directions of cortex. That is a reduced-rank regression, a regression whose coefficient matrix is forced to have low rank, with one difference from the textbook version. Reduced-rank regression picks its input and output subspaces from the relation between the two sides. Here they are fixed in advance from each side separately, so the subspaces are a choice about the data and only is a claim about the mapping.
The nonlinear case keeps the same constraint, not globally but at every point. The Jacobian of a map is its matrix of partial derivatives. It is the linear map that says how a small change in the input moves the output, and it is the right object to look at because a smooth network is linear in a small enough neighbourhood of any input.
Proposition 3. Let be differentiable, meaning it has derivatives everywhere. The Jacobian of the full map is
so for every input .
Proof. The chain rule says the derivative of a chain of maps is the product of the derivatives of its stages, so differentiate the three stages in turn. The projection is linear with Jacobian , the network contributes , and the reconstruction is linear with Jacobian . The rank of a product is at most the rank of any factor.
Read the formula from the right. A change in the image that is orthogonal to is killed by and does nothing. A change that survives is pushed through the local linear version of the network and then lands inside .
So seen from the image and from the cortex, the model is locally a rank-75 map everywhere, however nonlinear it is inside the bottleneck. An inductive bias is an assumption a model carries before it sees any data, and this one is written down. It is also a statement about this architecture and nothing else. It does not say the visual system is low-rank.
Racing loss
One network predicts both hemispheres, , so shared nonlinear features can serve both sides while the two response subspaces and stay separate. During development, plain joint training often let one hemisphere pull ahead of the other. The objective that fixed it compares each side by cosine similarity,
which is the cosine of the angle between the predicted and measured latent vectors in . It is 1 when they point the same way and 0 when they are at right angles, and it ignores the length of either vector. So it scores direction in the retained subspace rather than amplitude. The objective to maximise is
The second term is the ordinary average. The first rewards only the side that is behind, so it is the term that refuses to let the average be bought by one hemisphere alone.
To see what the first term does, use the identity . It holds because is whichever of and is not negative, so subtracting it from the sum leaves twice the smaller of the two. Substituting,
which is the total similarity over both hemispheres with a penalty on the gap between them. The penalty is an penalty, meaning it grows in proportion to the size of the gap rather than its square. The gradients, meaning how fast the objective rises when each score rises, follow by cases. If then and , so
The side that is behind gets three times the gradient of the side that is ahead, and the weights swap when they cross. Both sides always have positive weight, so neither is ever abandoned, and the pressure sits on whichever is currently worse. I called it racing because that is what it looked like in the training curves.
What the rewrite gives me is that a heuristic I arrived at by watching curves becomes a stated objective with known gradients. That is what lets the ablation below be read at all, where an ablation is a rerun with one piece of the method removed.
The target-conditioned perturbation
The second training mechanism gives the network a small look at the answer. Let be the hidden image representation just before the two output layers, which is the activity of the layer that feeds them. Let be the latent neural target for the same image, and a learned matrix that carries the 150 neural coordinates into the numbers of the hidden layer. During training the hidden state is replaced by
where the random vector has entries drawn independently from the bell curve centred at zero with unit spread, and is a diagonal matrix, zero everywhere except its main diagonal, holding the retained PCA eigenvalues, the variances of the measured responses along each kept axis. The denominator makes a weighted average of three vectors, the network's own hidden state, the projected true target, and a projected noise vector, with weights , and . The geometry is that is pulled along the line toward and then jittered.
The algebra pins down both parts. Since has mean zero, , and since ,
Only the noise term is random given and , and it enters with coefficient , so
Two things happen. The hidden state is shifted toward a projection of the true neural target, which is the teacher-guided part. And it is jittered with noise whose covariance is what does to the retained response variances, so along each latent axis the noise has the same spread as the measured responses have along that axis.
That is why is there rather than the same amount of noise in every direction. The jitter is shaped like neural variability as seen through the bottleneck, not like a sphere.
It is close in spirit to teacher forcing in sequence models, where the model is fed the true previous output during training instead of its own guess. But the target does not exist when the model is used on a new image, so the test-time version keeps only the structured noise with a sign flip,
That is a mismatch between what the network sees in training and what it sees at test time, and I do not have a probabilistic account of why it should be harmless. The ablation says the regulariser helped in this setup, and it does not say why.
Group pretraining
The third mechanism is about where training starts. Visual cortex shares structure across people and also has person-specific geometry, and there are eight participants, each with their own vertex space. Hyperalignment, a method from Haxby and colleagues, is one way to put them in one coordinate system. Each participant's response patterns are rotated by an orthogonal matrix into a shared space , with every and chosen together,
The double bars with the subscript F are the Frobenius norm, the square root of the sum of every squared entry of a matrix, so this minimises the total squared disagreement between each rotated participant and the shared space.
The orthogonality constraint is the point. An orthogonal matrix preserves every distance and every angle between a participant's response patterns, so the alignment can rename axes but cannot stretch, squash or collapse anyone's representational geometry to make them agree. Whatever agreement is found was there already.
I use aligned responses from every participant to train one group bottleneck network, then fine-tune a copy per person. So each participant's optimisation starts from rather than from random weights. It is a starting point that carries what the group has in common, not a claim that everyone's cortex shares a coordinate system, and the final model is separate for each person.
Results
Evaluation uses the Natural Scenes Dataset under the Algonauts 2023 protocol. The Natural Scenes Dataset is a public dataset in which eight people each looked at thousands of natural photographs inside a 7 tesla scanner, a stronger magnet than the usual 3 tesla that gives finer measurements. The Algonauts Project 2023 was a public challenge built on that dataset. It fixes which images are held out for testing and how predictions are scored, so numbers from different models can be compared.
The score is noise-normalized encoding accuracy over visual-cortex vertices. At each vertex the prediction is compared with the measured response, and the score is divided by that vertex's noise ceiling, which is the best score the measurement noise would allow. The reported number is the mean over participants and hemispheres.
The baseline fine-tunes CLIP ViT-B/32 per participant to predict the full response, so it learns directly in the original cortical space. F-BNet freezes CLIP and trains only the bottleneck map between the 300 image coordinates and the two sets of 75 response coordinates. Both timings are on one NVIDIA A40 GPU, the graphics chip that does the training arithmetic, with 32 images per training step.
| model | score |
|---|---|
| CLIP ViT-B/32, fully fine-tuned | 41.41 |
| F-BNet | 46.27 |
| F-BNet, no group pretraining | 44.86 |
| F-BNet, no target-conditioned perturbation | 45.54 |
| F-BNet, mean squared error instead of Racing | 44.34 |
The gap to the baseline is 4.86 points, about 11.7% relative, and F-BNet is higher in all sixteen participant and hemisphere columns. The three rows below it are the ablations, where one of the three training mechanisms is removed and the model is trained again. Removing group pretraining costs 1.41, removing the perturbation costs 0.73, and swapping the Racing objective for squared error costs 1.93.
That last swap changes the similarity measure from cosine to squared error as well as removing the balance term, so it does not isolate the penalty. Taken together the ablations are consistent with each of the three mechanisms contributing. They do not say how the three interact, because each run removes only one of them.
Ten epochs of the fine-tuned baseline took 403 seconds and F-BNet took 43, a ratio of about 9.4, where an epoch is one pass over the training images. The speed comes from the two changes to the optimisation, a frozen vision model and a target of 150 numbers in place of the full vertex space. It is a statement about this configuration rather than a result about how the cost scales.
What it does not say
The propositions above are about the architecture and the chosen split into two projections and a small map. On their own they say nothing about how cortex computes. In particular
- A low-rank predictor does not imply a low-rank visual system.
- PCA keeps variance, and variance is not the same thing as behavioural or representational relevance.
- 75 was picked empirically and is not an estimate of how many dimensions the neural response really has.
- Racing loss was never run against plain cosine without the balance term, so that term is not isolated.
- The target-conditioned perturbation sees the target in training and not at test time.
- Group pretraining does not establish a shared coordinate system across people.
- The scores cover eight participants with no statistical test across them.
What the work does show is that natural-scene encoding can be done well inside a compact response subspace, and that doing so turns a vague efficiency trick into three exact statements. The error splits into a latent part that training moves and a truncation part that only the choice of subspace moves. The Jacobian is rank-bounded at every input, so the model is an explicit rank bound on the image-to-brain map, built in before any data is seen. And the subspace, rather than its basis, is what the model commits to.
None of that establishes that cortex is low-rank. It only shows that a response subspace of 75 directions was enough for this performance on this data. The question I actually care about comes after that. Which compact neural geometries stay put across people, contexts and time, and what has to change when those conditions do.
References
- Allen et al., A massive 7T fMRI dataset to bridge cognitive neuroscience and computational intelligence, Nature Neuroscience, 2022.
- Gifford et al., The Algonauts Project 2023 Challenge: How the Human Brain Makes Sense of Natural Scenes, 2023.
- Radford et al., Learning Transferable Visual Models From Natural Language Supervision, ICML, 2021.
- Li et al., BLIP: Bootstrapping Language-Image Pre-training for Unified Vision-Language Understanding and Generation, ICML, 2022.
- Haxby et al., A common, high-dimensional model of the representational space in human ventral temporal cortex, Neuron, 2011.
- Jozwik et al., Deep neural networks and visuo-semantic models explain complementary components of human ventral-stream representational dynamics, Journal of Neuroscience, 2023.
- Khaligh-Razavi and Kriegeskorte, Deep neural networks reveal a gradient in the complexity of neural representations across the ventral stream, Journal of Neuroscience, 2014.
- Pearson, On lines and planes of closest fit to systems of points in space, Philosophical Magazine, 1901.