The Visual Cortex
In the past two weeks, I’ve focused on building similar structures and mechanisms for vision i.e., bridging the ganglion cells and the ERUs via the visual cortex (V1, V2 and so on).
The Visual Cortex
Architecture

Components
- Lateral Geniculate Nucleus (LGN) - Relays center surround retinal outputs in tonic and burst modes - depending on how active the eyes have been in the immediate past. Also, segregates the p-type and m-type ganglion cell streams
- V1 Primary Visual Cortex
- Layer 4 - Cells detect edges and motion
- Layer 2/3 - Integrates and reinforces lines in the same orientation, essentially stitching together small visual field stimuli
- Layer 5/6 - Feedback mechanisms to tune LGN / Layer 4 and transmit horizontally normalized signals
- V2 Secondary Visual Cortex - Groups edges to detect corners, foreground, background, etc
- V4 Tertiary Visual Cortex - Groups corners into curves while mapping hue and color combinations with invariance to lighting and viewpoint (via population coding)
- Inferotemporal Cortex (IT) - Houses neurons tuned to complex objects and faces, invariant to position and scale (again, via population coding). Note: the brain’s associative memory starts here, from the IT cortex itself!
Algorithms / Development
Building the Environmental Response System (ERS)
LGN implementation v1- Define the tonic and burst modes
- Define a center surround gaussian kernel which convolves on the incoming spike stream
- Apply a mode based on the neurotransmitters from later stages, essentially creating a systemic modulatory loop
- Define the STRF (spectro temporal receptive field) i.e., a 3D array for each neuron with different contrast-colour-direction affinities. These group of neurons contribute to population coding
- Hierarchically, create an array-like field with different affinities (Needs better logic)
Development Activity - https://github.com/akhil-reddy/beads/graphs/commit-activity
Building the visual cortex components - https://github.com/akhil-reddy/beads/blob/main/beads/core/eru/hub/visual/v_cortex.py
Please note that some code (class templates, function comments, etc) is AI generated, so that I spend more of my productive time thinking and designing. However, I cross-verify each block of generated code with its corresponding design choice before moving ahead.
Next Steps
Building the Environmental Response System (ERS)
- Refining the cortices
- Building the ERUs
- Neurotransmitters - Fed by vision’s bipolar and amacrine cells, for example, to act on contrasting and/or temporal stimulus
- Focus - Building focus and its supporting mechanisms (of which acetylcholine is one)
Deployment
- Overlaying video frames onto the retina, including code optimization for channel processing
- Overlaying audio clips onto the cochlea, including optimization for wave segment processing
- Parallelization / streaming of cellular events via Flink or equivalent