Featured2025ML and research engineerResearch project with the Zhen Lab

Gap Junction Connectomics

Built a CNN-based pipeline that segments gap junctions in 3D electron-microscopy volumes and converts them into electrical-connectivity measurements.

  • Biomedical AI
  • Computer Vision
  • Research

TL;DR

An end-to-end research pipeline for training custom U-Net variants, tiling and segmenting large electron-microscopy volumes, reconstructing 3D predictions, and measuring gap-junction connectivity between labeled neurons in C. elegans.

Problem

Gap junctions are sparse, thin structures in electron-microscopy data; identifying them across large volumes and assigning them to neuron pairs is difficult to do consistently by hand.

TL;DR

I built an end-to-end pipeline that trains custom CNNs to segment gap junctions, runs inference over large electron-microscopy volumes, and turns the resulting 3D masks into neuron-level electrical-connectivity measurements. The software covers the full path from image tiles to contact-normalized connectivity matrices.

Why it matters

Gap junctions provide direct electrical coupling between cells and are important for understanding neural-circuit structure and plasticity. In EM volumes they are sparse and difficult to trace manually, so consistent automated segmentation can make electrical-connectome analysis practical across developmental conditions.

Dataset / inputs

The workflow expects selectively stained electron-microscopy slices plus a labeled neuron-segmentation volume. The repository includes analysis notebooks for adult and dauer-stage C. elegans, but it does not distribute a small, ready-to-run example dataset or publish a final held-out benchmark.

Technical decisions

Large slices are divided into overlapping 512-pixel tiles so inference fits in memory; predictions are then reassembled into full slices and stacked into a 3D volume. The model code supports 2D U-Nets and hybrid 3D-to-2D variants, while the training loop uses generalized Dice loss and reports recall, precision, and F1— metrics that expose failure on a sparse foreground class better than accuracy.

Challenges

Segmentation is only half the problem. Predicted pixels must also be assigned to labeled neurons and normalized by physical contact. The analysis stage therefore extracts neuron membranes, expands labels to those boundaries, measures gap- junction expression per neuron, and produces pairwise raw and normalized connectivity matrices.

Methods

  • Trained custom U-Net variants with generalized Dice loss to handle sparse foreground labels
  • Split large EM slices into overlapping tiles, ran batched inference, and stitched predictions back into slices
  • Stacked predicted slices into 3D segmentation volumes
  • Expanded labeled neurons to membrane boundaries and assigned predicted gap junctions to neurons and neuron pairs
  • Exported raw and contact-normalized electrical-connectivity matrices

Results

  • Implemented a reusable GapJunctionSegmenter pipeline for tiling, inference, stitching, and 3D volume assembly
  • Implemented a GapJunctionAnalyzer pipeline for per-neuron expression, pairwise connectivity, contactomes, and normalized statistics
  • Applied the workflow to adult and dauer C. elegans EM datasets in the included analysis notebooks

Lessons learned

  • For sparse biological structures, loss design and precision/recall trade-offs matter more than pixel accuracy
  • Separating segmentation from connectome analysis makes each stage easier to validate and reuse

Limitations

  • The public repository does not report a final held-out segmentation score, so model quality cannot yet be compared from the README alone
  • Training and inference are computationally intensive; a CUDA-capable GPU is recommended
  • The workflow requires selectively stained EM data and corresponding neuron-segmentation masks

Next steps

  • Publish held-out precision, recall, F1, and dataset-split details with model checkpoints
  • Move dataset paths and run settings into portable configuration files
  • Add a reproducible example volume that demonstrates segmentation through connectivity export

Related projects

Featured2025

Robotic Vision for Clothing Detection & Segmentation

Built a containerized vision service that streams camera frames from a mobile robot and returns clothing detections or segmentation geometry.

Outcome: Separated capture from inference so lightweight clients can send one JPEG frame at a time and receive compact geometry without hosting model weights or accumulating stale frames.

  • Computer Vision
  • Robotics
  • MLOps / Deployment
Featured2025

DTI Cancer Connectomics

Built a diffusion-MRI connectomics pipeline comparing DMN/ECN white-matter structure in 40 pediatric brain-tumor survivors and 36 healthy controls.

Outcome: Turned diffusion MRI and cortical parcellations into de-identified, analysis-ready connectivity matrices and documented significant working-memory and processing-speed differences between survivors and controls.

  • Neuroimaging
  • Data Analysis
  • Research