# Direction selectivity requires nonlinearity

Thanks to Damon Clark at Yale and Jacob A. Zavatone-Veth at Harvard for pointing out the following to me.

I had always thought that you could get a direction-selective neuron with a linear filter that is spatiotemporally inseparable, so that it is “tilted” in spacetime, with the gradient defining a speed and direction. I always thought you would get a bigger response for a stimulus moving at the speed and in the direction matching the filter, than for one moving in the opposite direction. I know models, like the motion energy model, then tend to place a nonlinearity after the linear filtering, but I didn’t think this was necessary for direction-tuning when the filter is already tilted in this way.

Well… yes it is (although it does slightly depend on what you mean by direction-selective). The video below shows a Gaussian-blob stimulus passing over a receptive field, first left to right and then right to left.

The leftmost panel shows the tilted spatiotemporal linear filter representing the receptive field. How to read this function: It responds weakly to the present stimulus (tau=0), responding most to stimulation at x=-50. It responds more strongly to stimuli as we go back into the past. It responds most strongly to stimuli that were presented at a time tau=40 units ago, located at x=-11. As we go further back into the past, its responds decays away. It responds weakly to stimuli presented 70 time-units ago, most strongly to those that were at x=10 units 70 time-units ago. This panel doesn’t change, as the filter’s shape is a permanent feature (it’s time-invariant).

The middle panel shows the stimulus. The bottom row (tau=0) shows where the stimulus is now; the rows above show where it was at times progressively further into the past. At any given moment of time, the stimulus is a Gaussian function of position. The contour lines show the filter for comparison.

The right-hand panel shows the response of the linear filter, which is the inner product of the filter and the stimulus at every moment in time.
The red curve shows the response when the stimulus moves rightward; the blue curve shows the response when the stimulus moves leftward.

Here is the response as a function of time for both directions of motion. Notice that although the response to the leftward stimulus peaks at a much higher value, the total response is the same for both directions of motion. I had never realised this was the case until Damon pointed it out to me and found it hard to believe at first — although as the video makes clear, it’s just because in both cases the stimulus is sweeping out the same volume under the filter.

So can you describe this linear filter as direction-selective? It certainly gives a different response to the same stimulus moving rightward vs leftward, so I’d argue to that extent you can describe it as such. But since the total response is the same for both directions, it’s hard to argue it has a preferred direction. And it’s certainly true that to use it in any meaningful way, you’d want to apply a nonlinearity, whether squaring or a threshold or whatever. For example, if you wanted to use this “leftward filter” to drive a robot to turn its head to follow a leftward moving object, you’d be in trouble if you just turned the head leftward by an angle corresponding to the output of this filter. Sure the robot would turn its head left by so many degrees as an object passed left in front of it, but it would also turn its head left by the exact same angle if an object passed rightward! So in that sense, this filter is not direction-selective, and a nonlinearity is required to make it so.

Many thanks Damon and Jacob for taking the time to explain this to me!

The (slightly crummy) Matlab code I wrote to generate this video is below:

 function JDirTest clear all; close all; % This makes the tilted RF xp = [-100:100]; X = exp(-(xp./20).^2) figure(1000) plot(xp,X); nt = 100; %number of time samples tau = [1:nt]; tG = exp(-((tau-40)./20).^2); % just shifted so as to be causal for j = 1:nt rim(j,:) = circshift(X,j-round(nt/2)); lim(j,:) = circshift(X,round(nt/2)-j); RFim(j,:) = circshift(X,j-round(nt/2)); RFim(j,:) = RFim(j,:) .* tG(j); end figure imagesc(xp,tau,RFim); xlabel(‘position x ‘) ylabel(‘time \tau (seconds before present)’) set(gca,’ydir’,’norm’) title(‘Linear spatiotemporal filter f(x,\tau)’) % Now run a nice simulation figure(‘pos’,[20 374 1495 420]) for jdirection=1:2 if jdirection==1 x0=-100; speed=+1; colspeed = ‘r’; label=’rightward’; else subplot(1,3,3) hold on x0 = +100; speed=-1; colspeed=’b’; label=’leftward’; end subplot(1,3,1) imagesc(xp,tau,RFim); set(gca,’ydir’,’norm’) xlabel(‘position x ‘) ylabel(‘relative time \tau (seconds before present)’) set(gca,’ydir’) time = [0:300]; for jt=1:length(time) timenow = time(jt); % delete(h) % h = plot(stimuluslocation(t subplot(1,3,1) title(sprintf(‘Current time is t=%3.0f’,timenow)) subplot(1,3,2) s = stimulus(xp,tau,timenow); hold off imagesc(xp,tau,s); hold on contour(xp,tau,RFim); set(gca,’ydir’,’norm’) xlabel(‘position x ‘) ylabel(‘relative time \tau (seconds before present)’) set(gca,’ydir’) title(‘Stimulus s(x,t-\tau)’) drawnow % Do inner product of current stimulus with filter: response(jt) = sum(sum( s.*RFim)) ; % Plot it if jt>1 subplot(1,3,3) h(jdirection) = plot(time(1:jt),response(1:jt),’-‘,’col’,colspeed); xlim([0 max(time)]) ylim([0 1000]) lab{jdirection} = sprintf(‘%s, total = %3.0f’,label,trapz(time(1:jt),response(1:jt))); legend(h,lab) title(‘Response’) xlabel(‘time (s)’) end end end % do other direction % Stimulus is a Dirac delta function, x = vt + x0 function s = stimulus(xp,tau,time) % returns s(x,t-au) [xp2,tau2] = meshgrid(xp,tau); %s = 0*xp2; %s(xp2 == time – tau2 ) = 1; s = exp(-(xp-x0 – speed*(time – tau2)).^2/2/10^2); end end Posted in Jenny | Leave a reply Follow me on twitter here » RT @beth_research: If you have a spare 10 minutes please consider completing our role play study from Newcastle University! You will b… https://t.co/PQkb0DadSq [jcaread]RT @VivekNityananda: Bee Cognition meets Agriculture! With help from the @BBSRC, I'm organizing a FREE ONLINE symposium on Sep 8-9th bri… https://t.co/bvRNkaNoaw [jcaread]Really happy that our paper modelling praying #mantis #stereopsis is out in @PLOSCompBiol , after much work from Ja… https://t.co/SCMnwTdnzd [jcaread]RT @mathshistory: “A sex so little made to brave the thorns of science”: The historical representation of women in mathematics. Pro… https://t.co/tEV0WB5WDU [jcaread]Love this story https://t.co/tahchVfSW7 [jcaread]Deadline extended so you still have a chance to apply for this with the excellent @katvancleef. Would be of interes… https://t.co/X3h2P1QcXR [jcaread]Talking to fellow scientists young & old at #VSS2022 about scientific careers, I keep finding myself recommending t… https://t.co/Cl7CU4LOwc [jcaread]Huge thanks to @anya_hurlbert , @esernagor1 and Andrew Jackson for taking time to hear my practice talk for… https://t.co/pZqh3jBDYq [jcaread]Fantastic to be back at in person @VSSMtg #VSS2022. First time off the island since the pandemic and wonderful to m… https://t.co/xdRtOTt604 [jcaread]Great thread on academic writing by @lfoulkesy , full of helpful advice. https://t.co/CgnxQ3GqFc [jcaread]RT @katvancleef: JOB ALERT: 3-yr postdoc for our multi-centre diagnostic accuracy study. Help evaluate validity of screening tool fo… https://t.co/ESyQXML2Mo [jcaread]Great opportunity to work with @VivekNityananda https://t.co/FNH8AYixoe [jcaread]Fascinating PhD project with my colleague @esernagor1 https://t.co/deGJonmb04 [jcaread]Actually, let's do a poll. How about "I use the term 'Keplerian array' to refer to a representation of binocular ge… https://t.co/UrRQhjN8id [jcaread]#stereo ppl of Twitter, I need your help. Plotting disparity on axes of left, right visual angle, as in this image… https://t.co/xr7C8mYFrx [jcaread]Also, @NCL_medresearch is offering 2 fully-funded PhD studentships specifically for Black students resident in the… https://t.co/UwWiP6ozgp [jcaread]Newcastle University is seeking to recruit new senior academics in the following broad areas: Digital & Data, Agein… https://t.co/7U1t5QexSQ [jcaread]Several #neuroscience #PhD opportunities have just been announced @NeuroNCL: https://t.co/3kZ21iMXRe [jcaread]Excellent article on how to be a good PhD student (her supervisor sounds good too!) https://t.co/Yi9f618HxJ [jcaread]Great opportunity for a #artist with personal experience of #stroke https://t.co/4MCv571ImU [jcaread] Follow @jcaread !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document, "script", "twitter-wjs"); Proudly powered by WordPress | Cookies & Privacy