GeneSegNet: a deep learning framework for cell segmentation by integrating gene expression and imaging

Yuxing Wang, Wenguan Wang, Dongfang Liu, Wenpin Hou, Tianfei Zhou, Zhicheng Ji

Abstract

When analyzing data from in situ RNA detection technologies, cell segmentation is an essential step in identifying cell boundaries, assigning RNA reads to cells, and studying the gene expression and morphological features of cells. We developed a deep-learning-based method, GeneSegNet, that integrates both gene expression and imaging information to perform cell segmentation. GeneSegNet also employs a recursive training strategy to deal with noisy training labels. We show that GeneSegNet significantly improves cell segmentation performances over existing methods that either ignore gene expression information or underutilize imaging information.

Introduction

In the field of spatial transcriptomics, particularly In Situ Hybridization (ISH), researchers aim to map the precise location of specific RNA molecules within tissues. A critical bottleneck in this process is cell segmentation: the task of defining cell boundaries to accurately assign RNA "reads" to individual cells.

Existing approaches typically fall into two categories, both with significant drawbacks. Image-based methods often rely on fluorescent stains (like DAPI) that primarily highlight nuclei, frequently missing the full cell body and struggling with low-contrast images. Conversely, gene-based methods infer boundaries from RNA spatial distribution but often produce artificial, circular cell shapes that fail to reflect true tissue morphology. GeneSegNet addresses these limitations by simultaneously utilizing both imaging and gene expression data.

Methods

GeneSegNet is built on a U-Net architecture, a standard for medical image segmentation, but introduces several key innovations to handle multimodal data and noisy labels.

  • Multimodal Input: The framework converts discrete RNA spatial coordinates into a continuous "pseudoimage" using 2D Gaussian kernels. This allows the neural network to process gene density and pixel intensity (from DAPI images) within the same mathematical space.
  • Three-Part Output: The model predicts a confidence map (cell probability), a center map (cell centroids), and an offset map (pixel distance from the center). This combination enables precise instance segmentation, even in densely packed environments.
  • Recursive Training Strategy: To overcome the challenge of noisy biological training labels, GeneSegNet employs a recursive loop. It trains on initial labels, generates predictions, refines those boundaries using a level-set algorithm, and then uses these refined predictions as updated labels for subsequent training rounds.
Overview of the GeneSegNet framework (a) and the underlying U-Net architecture (b).

Datasets

The authors validated GeneSegNet across three distinct scenarios to ensure robustness:

  1. Simulation Dataset: A synthetic benchmark with known "ground truth" to test noise tolerance and gene abundance.
  2. Human Non-Small-Cell Lung Cancer (NSCLC): Data from the Nanostring CosMx platform, representing a dense and complex tissue environment.
  3. Mouse Hippocampus (CA1 region): Data from in situ sequencing, representing a scenario with sparser RNA reads.

Key Results

GeneSegNet demonstrated superior performance across multiple metrics compared to both image-only (e.g., Cellpose) and gene-only (e.g., Baysor) methods.

  • Superior Accuracy: In simulations, GeneSegNet consistently achieved higher Intersection over Union (IoU) scores for both cell morphology and gene assignment.
  • Robustness to Noise: While image-only methods suffered significantly as image quality decreased, GeneSegNet maintained high accuracy by leveraging gene expression data.
  • Recursive Gains: The recursive training strategy provided a 5% to 15% performance boost over standard single-round training, typically converging within three iterations.
  • Biological Realism: Qualitatively, the model produced smoother, more realistic cell boundaries that captured the full cell body rather than just the nucleus.
Visual comparison of GeneSegNet segmentation results across different tissue types, showing accurate boundary detection in both sparse (hippocampus) and dense (lung) environments.

Discussion and Future Work

By acknowledging that human-provided "ground truth" in biology is often flawed, GeneSegNet's self-correcting AI eventually outperforms its initial training labels. This improved segmentation leads to more reproducible cell clustering and reliable downstream biological discovery.

While powerful, the recursive strategy increases computational intensity, though it remains manageable on standard hardware. Future work may focus on improving memory efficiency for massive high-resolution slides and enhancing generalizability through more diverse pre-training datasets.

Summary updated

BibTeX
@inproceedings{wang2023genesegnet,
  author = {Yuxing Wang and Wenguan Wang and Dongfang Liu and Wenpin Hou and Tianfei Zhou and Zhicheng Ji},
  title = {{GeneSegNet: a deep learning framework for cell segmentation by integrating gene expression and imaging}},
  booktitle = {Genome},
  year = {2023},
  doi = {10.1186/s13059-023-03054-0},
}
Figure