honglab.

Decoding the neural architecture of behavior.

Science & Art

Neural network art from microscopy: a 10-minute vector trace

A single fluorescence stack of a zebrafish larva's optic tectum contains thousands of dendritic arbors, each one a tangled signature of developmental biology.

Neural network art from microscopy: a 10-minute vector trace

Yet on a 4K monitor, that same stack registers as visual static — a mossy smear where the eye cannot find an anchor. This is the daily problem at the boundary of two practices: the neuroscientist who needs faithful reconstruction and the science communicator who needs imagery a viewer will actually look at. Vector tracing is the shortest path between those two demands. The promise — clean, scalable neural network art from raw microscopy — is achievable in roughly ten minutes once the workflow lives in muscle memory. The cost of that speed sits in the choices you make about contrast, contour, and what to leave behind.

A microscopy image is a record. A vector trace is an interpretation. The art lives in the negotiation between them.

Why the raw raster fails the eye

Human visual cortex devotes a substantial fraction of its neural real estate to detecting edges, contours, and contrast gradients — a bias hardwired into V1 long before any cultural training. A fluorescence stack saturates that bias by presenting every dendrite at roughly the same luminance as the background speckle, leaving the retina no clear edge to lock onto. The viewer does not experience this consciously; they experience restlessness, mild fatigue, the sense of "interesting but I can't look at it for long."

This is a measurable phenomenon in cognitive load studies: visual textures with low figure-ground contrast elevate fixation duration and reduce dwell time on the image. Art derived from such textures inherits the same problem, and the audience's attention quietly drifts elsewhere. The remedy is not better microscopy. The remedy is post-processing that pulls contrast, simplifies contour, and creates the luminance hierarchy the eye expects.

How vectorization actually works

Two toolchains dominate the conversion of neuron imagery into reusable vector form, and they sit at different points on the accuracy-versus-speed trade-off.

The first toolchain is image-based vector tracing. Software like Inkscape ships with Trace Bitmap, an implementation of the Potrace algorithm. Potrace reads a raster bitmap, classifies each pixel as foreground or background, and outputs a set of mathematically defined vector paths that reproduce the original shapes. Potrace offers several detection modes — Brightness Cutoff, Edge Detection, Color Quantization, and Centerline Tracing — each tuned to a different kind of input. For dense neural imagery, Edge Detection and Centerline Tracing produce the most usable results because they preserve thin dendritic processes rather than collapsing them into blobs.

The second toolchain is morphology-based reconstruction. Software such as ZEISS arivis Pro includes automatic neuron tracing modules that segment fluorescence channels and trace individual dendrites and axons as three-dimensional skeletons. These skeletons can be exported as SWC files — a simple text format describing each neuron's spatial position, radius, and parent-child connectivity. SWC output is the canonical handshake between neuroscience data and downstream visualization tools, including the rendering engines used in sci-art installations.

ApproachInputOutputBest forTime per image
Trace Bitmap (Brightness Cutoff)2D rasterFlat vector pathsHigh-contrast silhouettesUnder 1 minute
Trace Bitmap (Edge Detection)2D rasterContour vector pathsThin processes, dendrites2–3 minutes
Trace Bitmap (Centerline)2D rasterSingle-stroke pathsSkeletal line art2–4 minutes
ZEISS arivis Pro auto-trace2D / 3D fluorescenceSWC skeleton + meshFaithful morphology15+ minutes
DeepNeuron (open-source)2D / 3D microscopySWC skeletonHigh-throughput reconstructionMinutes per stack

The 10-minute workflow lives in the upper rows: raster vectorization with manual cleanup, not morphology reconstruction. SWC files are precise — they encode the truth of the data — but they are not yet art. To become art, the trace must be reinterpreted by the same visual logic the cortex applies to any image it is willing to keep looking at.

The 10-minute workflow

The procedure below is what fits inside the title's promise. It assumes a single 2D fluorescence frame exported as a flattened PNG or TIFF at workable resolution, and a workspace already configured in Inkscape and GIMP.

1. Import the frame into Inkscape. Convert any text layers to paths if you are working from a published figure rather than your own acquisition.

2. Duplicate the layer. The original stays as a hidden reference; the duplicate will be the one you vectorize.

3. Pre-process in GIMP or a similar raster editor: apply a Gaussian blur at radius 1–2 pixels to suppress noise, then use Levels to push the contrast so that dendrites read as crisp black against a clean background. This step is where the aesthetic decision begins; the contrast curve you choose here sets the entire mood of the final trace.

4. Run Trace Bitmap with Edge Detection or Centerline Tracing. Start with the default threshold and inspect the result at 800% zoom, where Potrace's handiwork becomes visible.

5. Delete the raster layer. Move the resulting paths above the hidden original so you can flip the original on and off for comparison.

6. Manual cleanup: merge the stray short paths Potrace generates around branch points, delete the speckles below a length threshold you choose (the eye reads anything below roughly eight pixels as noise), and smooth the acute angles into gentle curves using the node tool.

7. Export as SVG. The trace is now infinitely scalable and weighs under 50 KB for a typical dendritic field — small enough to live inside any web layout or installation renderer.

Step six is where the human skill lives. Potrace is fast but literal: it draws every contour it can detect, including the contours of noise. Your job in the cleanup pass is to keep the dendritic topology while discarding the texture that surrounds it. That single choice separates a neuroscience figure from a piece of neural network art.

Aesthetic principles the trace must respect

The trace is not finished when it looks tidy. It is finished when it satisfies three principles the visual cortex enforces whether the viewer knows it or not.

Contrast hierarchy. The image should have at least three readable luminance tiers — primary dendrite, secondary dendrite, background. Potrace flattens everything into a binary; the cleanup pass must reintroduce hierarchy, usually by adjusting stroke weights on different path groups until the eye can sort the branching order at a glance.

Contour density. A neural trace that is too dense reads as visual noise; a trace that is too sparse reads as empty. The eye wants a moderate density of recognizable branching events per unit area at normal viewing distance. Branches that fall outside that natural density should either be thickened and emphasized or removed entirely.

Negative space. The trace earns its scale by what it leaves blank. A dendritic tree rendered against a generous margin of white reads as anatomy; the same tree rendered edge-to-edge reads as wallpaper.

Applied to public engagement, these principles double in weight. Outreach assets built from traced microscopy — exhibition prints, web hero images, sonified installation projections — must rest the gaze of a viewer who arrived to look at art, not at science. A clean SVG is not yet an outreach asset; outreach demands context, a label, a scale bar, a caption that connects the viewer to the underlying biology without crowding the line work. The vector format is what makes the leap possible. It is light enough to drive real-time rendering engines, simple enough to feed audio parameter mappings for sonification, and open enough to circulate under permissive licenses for the next exhibit, the next classroom, the next science festival booth.

Where the method breaks

The 10-minute workflow is not a substitute for rigorous morphological reconstruction. Automated tracing tools such as the DeepNeuron open-source toolbox report average accuracy around 98% on benchmark datasets, but accuracy in those benchmarks refers to topological fidelity, not visual quality. A 2% error rate in topology can produce dozens of spurious branches in a single image, and the cleanup phase is what converts those errors into visual coherence rather than visible artifacts.

Two situations call for a different method. The first is publication-quality morphology, where every spine and every bouton must be accurately counted and measured. The second is volumetric data — full 3D stacks where the science demands depth-resolved reconstruction. In both cases the appropriate tool is a morphology reconstruction pipeline such as ZEISS arivis Pro or DeepNeuron, followed by manual proofreading that can take hours per neuron and months for an entire network. To put that labor in perspective, traditional electron microscopy reconstruction of one cubic millimeter of brain tissue can require roughly a year and a half of continuous slicing and imaging — a figure that explains why automated tracing tools, with all their imperfections, have become standard in modern connectomics.

A third limitation is aesthetic: not every microscopy image is a candidate for vectorization. Specimens with very low signal-to-noise ratio, or samples where the staining bleeds outside the cells of interest, will produce vector outputs that look more like noise than like art. The honest answer in those cases is to return to the sample preparation step, not to push harder on the trace.

The principle to take home

Microscopy images fail as art because they fail as images. The eye needs contrast, hierarchy, and negative space, and the raster cannot supply them at the resolution of attention. Vectorization is the corrective instrument, and a careful ten-minute pass through Inkscape plus a raster pre-processor is the shortest path to artwork that respects both the data and the viewer.

Make the trace clean enough that a non-specialist can rest their gaze on it, and faithful enough that a specialist can still recognize the cell type.

That is the operating principle. Everything else in the workflow — the choice of mode, the cleanup pass, the threshold for noise, the stroke weights, the margin of white around the tree — is a means of holding both ends of that sentence at once.

FAQ

Why does raw microscopy imagery often look unappealing to the human eye?
Raw fluorescence stacks often lack clear edges and figure-ground contrast, causing the visual cortex to struggle with processing the dense, uniform textures.
What is the difference between image-based vector tracing and morphology-based reconstruction?
Image-based tracing converts raster pixels into vector paths for visual art, while morphology-based reconstruction creates 3D skeletons and meshes for scientific measurement and data analysis.
Which Inkscape tracing modes are best for neural imagery?
Edge Detection and Centerline Tracing are the most effective modes because they preserve thin dendritic processes instead of collapsing them into solid blobs.
How can I improve the aesthetic quality of a vector trace?
You should apply a Gaussian blur and adjust levels during pre-processing to increase contrast, then manually clean up the paths by removing noise and smoothing acute angles.
Is the 10-minute vectorization workflow suitable for scientific research?
No, this workflow is designed for visual communication and outreach; it is not a substitute for rigorous morphological reconstruction required for publication-quality data.