Neural imaging

Following synapses as memories form.

An image-analysis pipeline for longitudinal synaptic structural plasticity.

The University of Hong Kong · Cora Lai’s groupApr–Nov 2025

From image stacks to tracked spines

During my internship in Cora Lai’s group at the University of Hong Kong, I worked on quantifying synaptic structural plasticity from in vivo two-photon images. I developed a pipeline that detects spines in 2D slices, links them across depth into 3D objects, and matches their identities across imaging sessions.

The workflow combines deep object detection, overlap-based linking across slices, and temporal matching using motion, depth, and appearance. This turns manual image-by-image comparisons into structured tracks for studying spine formation and elimination.

2D detection

The detector achieved F1 = 0.77 ± 0.03 in the project evaluation, compared with 0.68 ± 0.04 for the Vogel baseline and 0.39 ± 0.07 for DeepD3. The montage below shows example detections on individual optical slices.

Example 2D spine detections, with blue boxes marking candidate spines. This montage illustrates detection outputs; aggregate scores come from the project evaluation.

3D association across depth

Linking detections across neighbouring slices produced more consistent 3D spine identities. HOTA was 98.10 ± 0.34, compared with 90.43 ± 1.57 for the connected-component baseline.

Across-depth association: predicted and ground-truth tracks at left, and spine IDs through successive slices at right. Original project-report Figure 4.

4D tracking across sessions

Across time, the pipeline achieved HOTA = 88.37 and IDF1 = 82.81. The example shows how identities can be matched between day 1 and day 2 despite differences in position and imaging depth.

Across-time tracking: day 1/day 2 maximum-intensity projections above, with identity-labelled optical slices below. Original project-report Figure 5.
The reported dataset contains 55 image stacks from one adult mouse, split into 44 training, 6 validation, and 5 test stacks. Local tissue motion, changing spine shape, and crowded regions remain sources of missed links or identity switches.

Outcome

I delivered the analysis pipeline to laboratory members to support routine image annotation and analysis.

Get in touch

Let’s talk about brains & ideas.

Interested in memory, neural circuits, and biologically grounded computation.

Email me
Open full-resolution image ↗