Cell segmentation method, device, storage medium and program product based on spatial omics sequencing
By segmenting the whole slice image into blocks and identifying heterogeneous regions, and selecting appropriate preprocessing parameters for deep learning segmentation, the problem of low cell segmentation accuracy in existing technologies is solved, achieving higher segmentation accuracy and recognition rate.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SAILU LIFE SCIENCES CO LTD
- Filing Date
- 2026-01-26
- Publication Date
- 2026-05-05
AI Technical Summary
Existing cell segmentation techniques suffer from low segmentation accuracy due to variations in image quality, staining depth, and brightness across different laboratories. They also struggle to define cell boundaries in low-contrast or blurry areas, leading to false positives and false negatives, and exhibiting insufficient generalization ability.
By dividing the whole slice image into blocks, identifying heterogeneous regions, and selecting appropriate preprocessing parameters based on the type of heterogeneity, cell segmentation is performed using a deep learning segmentation model, avoiding the use of a single preprocessing parameter and improving segmentation accuracy.
It improves the accuracy and recognition rate of cell segmentation, reduces the learning difficulty of deep learning segmentation models, makes them more focused on recognizing the biological morphology of cells, and enhances the segmentation effect under different conditions.
Smart Images

Figure CN121582926B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gene technology, and in particular to a cell segmentation method and system based on spatial omics sequencing, a computing device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] Spatial omics technology aims to perform large-scale sequencing of molecules (such as RNA, proteins, and chromatin accessibility) in tissues while preserving the original spatial location information of cells. Among these, sequence-based technologies, especially spatial transcriptomics, are currently the mainstream and hot topic. It cleverly combines high-throughput sequencing (NGS) with spatial location coding.
[0003] Cell segmentation refers to the process of dividing a cell image into several non-overlapping regions based on features such as grayscale, color, texture, and geometry. This ensures that these features exhibit similarities within the same region and significant differences between different regions. This is the cornerstone of much biomedical research, and its accuracy directly affects the reliability of almost all subsequent analyses, including cell counting, morphological analysis, and gene expression quantification. Common cell images are taken with a microscope and include fluorescence images and bright-field images, such as fluorescence images stained with the nuclear dye ssDNA and H&E bright-field images stained with hematoxylin and eosin.
[0004] The combination of cell segmentation and spatial omics, which classifies molecules in tissues into individual cellular regions, is an important means to improve the resolution and quantitative accuracy of spatial omics data. Improving the recognition rate of cell segmentation is a crucial issue in the field. Existing cell segmentation techniques are not adaptable to images produced by different laboratories, and the segmentation effect is limited by staining depth, image brightness, and contrast, resulting in low segmentation accuracy. Summary of the Invention
[0005] To address the existing technical problems, this invention provides a cell segmentation method and system based on spatial omics sequencing, a computing device, a computer-readable storage medium, and a computer program product, which can improve the accuracy of cell segmentation.
[0006] In a first aspect, a cell segmentation method based on spatial omics sequencing is provided, comprising: acquiring a collected whole-slice image, wherein the whole-slice image indicates the distribution characteristics of spatial omics signals in the tissue slice; dividing the whole-slice image into blocks to obtain multiple image blocks, identifying whether heterogeneous regions exist in the multiple image blocks, and obtaining identification results; preprocessing each image block according to the identification results to obtain preprocessed image data corresponding to each image block; forming the input of a deep learning segmentation model based on the preprocessed image data corresponding to each image block, and outputting the segmentation results of each image block through the deep learning segmentation model; and obtaining each cell region in the whole-slice image based on the segmentation results of each image block.
[0007] In a second aspect, a computing device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor causes the processor to perform the steps of the cell segmentation method based on spatial omics sequencing provided in the embodiments of this application.
[0008] Thirdly, a computer-readable storage medium is provided, storing a computer program that, when executed by a processor, causes the processor to perform the steps of the cell segmentation method based on spatial omics sequencing provided in the embodiments of this application.
[0009] Fourthly, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the cell segmentation method based on spatial omics sequencing provided in the embodiments of this application.
[0010] This application acquires a full-slice image, divides the full-slice image into blocks to obtain multiple image blocks, identifies whether heterogeneous regions exist in the multiple image blocks, and obtains identification results. The identification results include whether heterogeneous regions exist in the image blocks and the heterogeneity type corresponding to the image blocks with heterogeneous regions. Based on the heterogeneity type of the heterogeneous region, it finds preprocessing parameters corresponding to the heterogeneity type, and uses the preprocessing parameters corresponding to each heterogeneity type to preprocess each image block to obtain preprocessed image data corresponding to each image block. Based on the preprocessed image data corresponding to each image block, it forms the input of a deep learning segmentation model, and outputs the segmentation results of each image block through the deep learning segmentation model. The segmentation results of each image block are merged and stitched together to obtain each cell region in the full-slice image. By preprocessing each image block according to the heterogeneity type in the identification results, it avoids using a single preprocessing parameter to preprocess uneven image blocks, thereby improving the accuracy of cell segmentation. Attached Figure Description
[0011] Figure 1This is a diagram illustrating the application environment of a cell segmentation method based on spatial omics sequencing in one embodiment.
[0012] Figure 2 This is a flowchart of a cell segmentation method based on spatial omics sequencing in one embodiment;
[0013] Figure 3 This is a schematic diagram of two different heterogeneous types in one embodiment;
[0014] Figure 4 This is a schematic diagram of the segmentation results after performing cell segmentation on two image blocks in a whole slice image using different preprocessing parameters in one embodiment.
[0015] Figure 5 This is a schematic diagram of a cell segmentation device based on space omics sequencing in one embodiment;
[0016] Figure 6 This is a schematic diagram of the structure of a computing device in one embodiment. Detailed Implementation
[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the specification of this invention is for the purpose of describing particular embodiments only and is not intended to limit the scope of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0019] In the following description, the expression “some embodiments” refers to a subset of all possible embodiments. However, it should be understood that “some embodiments” can be the same subset or different subsets of all possible embodiments and can be combined with each other without conflict.
[0020] Cell segmentation refers to the process of dividing a cell image into several non-overlapping regions based on features such as grayscale, color, texture, and geometry. This ensures that these features exhibit similarities within the same region and significant differences between different regions. This is the cornerstone of much biomedical research, and its accuracy directly affects the reliability of almost all subsequent analyses, including cell counting, morphological analysis, and gene expression quantification. Common cell images are taken with a microscope and include fluorescence images and bright-field images, such as fluorescence images stained with the nuclear dye ssDNA and H&E bright-field images stained with hematoxylin and eosin.
[0021] The development of cell segmentation technology has evolved from traditional image processing to modern deep learning. Traditional cell segmentation includes: thresholding segmentation based on pixel grayscale values for binarization; edge detection segmentation based on points with significant brightness changes in the image to delineate the predicted cell contours; and watershed algorithms that treat the image as a terrain surface and grayscale values as elevation, simulating a flooding process. Common tools for deep learning segmentation include: QuPath, StarDist, Cellpose, and Deepcell Mesmer.
[0022] Spatial omics technology aims to perform large-scale sequencing of molecules (such as RNA, proteins, and chromatin accessibility) in tissues while preserving the original spatial location information of cells. Among these, sequence-based technologies, especially spatial transcriptomics, are currently the mainstream and hot topic. It cleverly combines high-throughput sequencing (NGS) with spatial location coding.
[0023] The combination of cell segmentation and spatial omics, which classifies molecules in tissues into individual cellular regions, is an important means to improve the resolution and quantitative accuracy of spatial omics data. Improving the accuracy and recognition rate of cell segmentation is a crucial issue in this field.
[0024] Space omics sequencing mainly includes the following steps: tissue preparation, tissue staining and imaging, permeabilization and capture, in situ reverse transcription, library construction and sequencing, and data analysis and visualization. Tissue preparation involves thin-layer slicing (typically 5-10 μm) of fresh frozen tissue or FFPE samples and placing them on specially coated slides. The main purpose is to preserve tissue morphology and RNA integrity. An array of oligonucleotide probes carrying spatial barcodes is immobilized on the slide surface. Tissue staining and imaging involves H&E staining or fluorescence imaging of the slices, primarily to obtain the morphological background of the tissue for subsequent integration and analysis with molecular data. Permeabilization and capture involves permeabilizing the tissue slices to release intracellular mRNA, which then binds to the nearest barcode probe on the slide. The main purpose is that each released mRNA molecule binds to a probe with a unique spatial coordinate barcode. In situ reverse transcription uses the bound mRNA as a template to perform an in situ reverse transcription reaction. The main goal is to generate a cDNA library with spatial barcodes, permanently recording spatial information within the cDNA molecules. Library construction and sequencing involve recovering cDNA from a glass slide, preparing an NGS library, and performing high-throughput sequencing. The sequencing reads contain both the cDNA sequence (genetic information) and spatial barcodes (location information). Data analysis and visualization utilize bioinformatics methods to map the barcodes back to spatial coordinates, assign read counts to each point or region, and overlay them onto tissue images.
[0025] Deep learning cell segmentation models (such as U-Net, Cellpose, StarDist, etc.) typically rely on features learned from data, such as texture, color, shape, and boundaries. Their performance is heavily dependent on the quality of the input data for several reasons:
[0026] 1. Feature Extraction and Representation Learning: Deep learning segmentation models abstract features from pixels layer by layer through structures such as convolutional layers. Low-quality images inherently contain biases in their raw material; uneven staining and abnormal brightness can cause variations in color and texture across different regions or even different slices of the same type of cell, disrupting the consistency of features learned during model training. Blur and loss of detail prevent the model from capturing sufficient edge and texture information, crucial for distinguishing tightly connected cells, resulting in insufficiently discriminative feature representations. Noise and artifacts provide the model with unrealistic or misleading features; the model may learn these non-biological signals, affecting its generalization ability.
[0027] 2. Training and Generalization: Data quality determines model cognition, primarily due to training data bias. If the training data contains a large number of images with specific quality issues, such as slices from the same darker staining batch, the model will tend to learn these biased feature representations. When encountering new data with different staining styles and brightness / contrast, the model's performance may drop significantly.
[0028] Limited generalization ability: A model trained on ideal, high-quality images often exhibits significantly reduced segmentation accuracy and robustness when dealing with low-contrast, high-noise real-world samples. This is because the model has not adequately learned how to handle these complex and disruptive conditions during training.
[0029] 3. Segmentation accuracy and confidence level
[0030] Boundary uncertainty: In low-contrast or blurry regions, the model has difficulty determining the exact cell boundaries, and its output segmentation mask may have rough or discontinuous boundaries, or the probability value may be at the confidence threshold.
[0031] False positives and false negatives:
[0032] Noise and certain artifacts, such as tiny impurities, can easily be misidentified by the model as cells or cell nuclei, resulting in false positives. Insufficient brightness or blurred cell boundaries may prevent the model from detecting real cells, causing false negatives.
[0033] When using deep learning segmentation tools, it was found that ideal preprocessing parameters could not be found to achieve high nucleus recognition rates in both dense and sparse regions. Models like U-Net, Cellpose, and StarDist rely on texture, edge, and contrast features learned from images to identify nuclei. In dense regions, nuclei are closely adjacent or even overlapping, and their grayscale and texture features are extremely similar, making it difficult for the model to find clear boundaries to segment individual nuclei.
[0034] Cellpose3 adds a preprocessing module compared to Cellpose2, but experimental results show that the model still cannot effectively balance the preprocessing conditions for densely populated and sparsely populated regions of cell nuclei. For this situation where there are no uniform preprocessing parameters applicable to cell segmentation in both densely populated and sparsely populated regions, improving the accuracy and recognition rate of cell segmentation is a crucial issue in the field. Existing cell segmentation techniques have low segmentation accuracy, mainly due to: First, boundary uncertainty: in low-contrast or blurry areas, the model struggles to determine precise cell boundaries, resulting in output segmentation masks with rough, discontinuous boundaries, or probability values at the confidence threshold (i.e., the model itself is hesitant). Second, false positives and false negatives: noise and certain artifacts (such as small impurities) are easily misidentified by the model as cells or cell nuclei, leading to false positives. Insufficient brightness or blurred cell boundaries may prevent the model from detecting real cells, causing false negatives. This application provides a combined analysis strategy to improve the recognition rate of cell segmentation in microscope images (including fluorescence images and bright-field images).
[0035] like Figure 1 As shown, Figure 1 This diagram illustrates the application environment of a cell segmentation method based on spatial omics sequencing in one embodiment. The gene sequencer 10 communicates with the computing device 20 by overlaying a tissue slice onto the sequencing chip of the gene sequencer 10. Probes capable of capturing RNA fragments are distributed on the surface of the sequencing chip of the gene sequencer 10. The gene sequencer 10 can read the base sequence information of the RNA fragments bound to the probes. Combined with the known probe positions, the spatial information of the base sequence can be obtained. The distribution of signal intensity (probe density capturing RNA fragments) captured by the sequencing chip in the gene sequencer 10 forms an RNA signal distribution map. The computing device 20 acquires and processes the whole-slice image to segment the cell regions within the whole-slice image. In an alternative implementation, the cell segmentation method based on spatial omics sequencing can also be implemented within the gene sequencer 10.
[0036] Please see Figure 2 This is a flowchart illustrating a cell segmentation method based on space omics sequencing according to an embodiment of this application. The cell segmentation method based on space omics sequencing is applied in a computing device and includes the following steps:
[0037] S11. Obtain the acquired full-slice image.
[0038] In this embodiment, the whole-slice image indicates the distribution characteristics of spatial omics signals in the tissue slice.
[0039] In this embodiment, the signal distribution image refers to an image that reflects the spatial omics signal distribution characteristics of a tissue section in physical space. It can be an RNA signal distribution image captured by a sequencing chip, or a fluorescence image taken after staining the genetic material of the section. Spatial omics can be understood as spatial multi-omics, including but not limited to one or more combinations of the following: transcriptomics, genomics, proteomics, metabolomics, lipidomics, glycomics, epigenomics, immunomics, microbiome, metagenomics, pharmacomics, etc. Spatial omics signals include but are not limited to one or more combinations of the following: transcriptomics signals, genomics signals, proteomics signals, metabolomics signals, lipidomics signals, glycomics signals, epigenomics signals, immunomics signals, microbiome signals, metagenomics signals, pharmacomics signals, etc.
[0040] S12. Divide the full slice image into blocks to obtain multiple image blocks, identify whether there are heterogeneous regions in the multiple image blocks, and obtain the identification result.
[0041] In this embodiment, the size of the full-slice image is generally quite large. When running a deep learning segmentation model, if the input image data is too large, exceeding the graphics card's memory size, it is necessary to segment the full-slice image into multiple smaller image blocks. For example, the original full-slice image is typically divided into blocks of 1024×1024 or 512×512 pixels, resulting in dozens of local image blocks.
[0042] In this embodiment, heterogeneous regions refer to areas exhibiting non-uniformity or difference on tissue sections. Heterogeneous region identification algorithms are used to identify the presence of heterogeneous regions in each image patch. These algorithms include, but are not limited to: identification methods based on multi-scale feature fusion, methods based on heterogeneous graph representation learning, methods based on dynamic clustering and pseudo-packet generation, and methods based on a visual-language model. When heterogeneous regions are identified in an image patch, heterogeneous types can also be identified using these algorithms. Heterogeneous type represents the category of the heterogeneous region. Heterogeneous types primarily reflect staining intensity, cell nuclear morphology, and aggregation. Heterogeneous types include, but are limited to, at least one of the following: densely populated nuclear region type, sparsely populated nuclear region type, tumor region type, inflammatory region type, mucosal region type, fat region type, blood cell region type, necrotic region type, fat region type, hemorrhage region type, etc. Figure 3As shown, Figure 3 This diagram illustrates two different heterogeneous types in one embodiment, with red representing one type and blue representing the other. Therefore, the identification result includes whether a heterogeneous region exists in the image patch and the heterogeneous type corresponding to the image patch containing the heterogeneous region.
[0043] S13. Based on the recognition results, preprocess each image block to obtain the preprocessed image data corresponding to each image block.
[0044] In this embodiment, the identification result includes whether there are heterogeneous regions in the image patch and the heterogeneity type corresponding to the image patch with heterogeneous regions. Therefore, when there are heterogeneous regions in the image patch, preprocessing parameters corresponding to the heterogeneity type can be found according to the heterogeneity type of the heterogeneous region. Using the preprocessing parameters corresponding to each heterogeneity type, each image patch is preprocessed to obtain preprocessed image data corresponding to each image patch. The preprocessed image data is an image after preprocessing each image patch based on one or more sets of preprocessing parameters. Preprocessing each image patch using the preprocessing parameters corresponding to each heterogeneity type facilitates the improvement of subsequent cell segmentation accuracy. Preprocessing includes, but is not limited to, at least one of the following: image normalization to reduce the influence of different staining conditions, and data augmentation. Data augmentation includes, but is not limited to, at least one of the following: image brightness adjustment, saturation adjustment, contrast adjustment, gamma value adjustment, hue adjustment, etc.
[0045] S14. Based on the preset processed image data corresponding to each image block, form the input of the deep learning segmentation model, and output the segmentation results of each image block through the deep learning segmentation model.
[0046] In this embodiment, the deep learning segmentation model includes, but is not limited to, models such as U-Net, Cellpose, and StarDist. The deep learning segmentation model is trained on a training dataset, which typically consists of a large number of precisely annotated biomedical microscopic images. These images cover diverse cell types (such as neurons, epithelial cells, and cell nuclei), different staining or fluorescent labeling methods (such as DAPI, GFP, and Actin labeling), and various imaging conditions and microscope modalities (such as confocal, wide-field, and phase-contrast microscopy). Each image is accompanied by a corresponding ground truth cell label, i.e., a binary mask map in which the outline of each cell is precisely delineated, sometimes distinguishing between cell boundaries and internal regions. To improve the model's robustness and generalization ability, the dataset incorporates images from different laboratories, different sample preparation processes, and with different cell densities, morphologies, and background noise, and is often further expanded using data augmentation techniques such as rotation, scaling, and brightness adjustment. This high-quality, diverse labeled data enables the model to learn the complex mapping relationship between raw pixels and cell segmentation masks. The segmentation result includes the segmented cell regions within an image patch.
[0047] S15. Based on the segmentation results of each image patch, obtain each cell region in the whole slice image.
[0048] In this embodiment, due to the enormous size of the full-slice image (typically tens of thousands of pixels), it cannot be directly input into a deep learning segmentation model for one-time segmentation. Therefore, the conventional approach is to cut the full-slice image into smaller, manageable image patches. Based on these image patches, each patch is input into a deep learning segmentation model for prediction, yielding local segmentation results for the cells within each patch. Finally, to obtain complete cell information across the entire image, these local results need to be seamlessly and correctly stitched back together, ultimately outputting a complete segmentation result image covering the entire slice, with each cell uniquely identified, thus obtaining the individual cell regions in the full-slice image.
[0049] In the above embodiments, a full-slice image is acquired, and the full-slice image is divided into blocks to obtain multiple image blocks. The presence of heterogeneous regions within these multiple image blocks is identified, and identification results are obtained. These identification results include the presence of heterogeneous regions within the image blocks and the heterogeneity type corresponding to the image blocks containing heterogeneous regions. Preprocessing parameters corresponding to the heterogeneity type are found based on the heterogeneity type. Each image block is preprocessed using these preprocessing parameters to obtain preprocessed image data for each image block. Based on the preprocessed image data for each image block, the input to a deep learning segmentation model is formed, and the segmentation results for each image block are output through the deep learning segmentation model. The segmentation results of each image block are then fused to obtain each cell region in the full-slice image. By preprocessing each image block according to the heterogeneity type identified in the identification results, the use of a single preprocessing parameter for preprocessing uneven image blocks is avoided, thereby improving the accuracy of cell segmentation.
[0050] In some embodiments, the step of preprocessing each of the image blocks according to the recognition result to obtain preprocessed image data corresponding to each of the image blocks includes:
[0051] Based on the identification results, determine the preprocessing parameter data;
[0052] Based on the preprocessing parameter data, each of the image blocks is preprocessed to obtain preprocessed image data corresponding to each of the image blocks.
[0053] In this embodiment, the identification result includes whether there are heterogeneous regions in the image patch, and the heterogeneity type corresponding to the image patch with heterogeneous regions. The preprocessing parameter data represents the preprocessing parameters used for each image patch. The preprocessing parameter data includes, but is not limited to, at least one of the following: normalization parameters and data augmentation parameters. The data augmentation parameters include, but are not limited to, at least one of the following: image brightness parameters, saturation parameters, contrast variation parameters, gamma values, hue parameters, etc. The preprocessing parameter data can be determined based on whether there are heterogeneous regions in the image patch.
[0054] Optionally, determining the preprocessing parameter data based on the recognition result includes:
[0055] When the recognition result indicates that there are no heterogeneous regions in the multiple image blocks, a set of uniform preprocessing parameters is determined;
[0056] When the recognition result indicates that one or more of the image blocks contain heterogeneous regions, the heterogeneous preprocessing parameters corresponding to each heterogeneous type in the recognition result are determined.
[0057] In this embodiment, when multiple image patches do not contain heterogeneous regions, the full-section image is considered a uniform region image. Preprocessing with a set of general uniform preprocessing parameters is sufficient. These uniform preprocessing parameters can be pre-configured or obtained using a random restart hill-climbing algorithm. When the identification result indicates that one or more image patches contain heterogeneous regions, the full-section image is considered a non-uniform region image. For each type of heterogeneity, a set of heterogeneous preprocessing parameters best suited to that type is found. These heterogeneous preprocessing parameters are preprocessing parameters obtained by searching for representative image patches of that heterogeneous type.
[0058] Biological samples (such as tissue sections) can introduce significant variations during preparation, staining, and imaging. These variations include: staining differences (H&E staining depth varies between batches and laboratories); differences in tissue type (dense tumor tissue and loose stromal tissue exhibit drastically different textures, cell densities, and contrasts); differences in lesion severity (normal cells, benign lesion cells, and cancer cells differ in morphology and chromatin distribution); and differences in imaging conditions (different scanners and lighting conditions produce varying noise and color deviations). A fixed set of preprocessing parameters (such as a fixed contrast stretching threshold and Gaussian filter kernel size) may only work well for one type of image. For another type of image, it may lead to over-enhancement, amplifying background noise or turning deeply stained areas into informationless color blocks; it may also cause under-enhancement, failing to highlight the edges and internal details of target cells, or even information loss, as incorrect parameters may smooth out crucial cell boundaries or textures.
[0059] Therefore, determining the heterogeneous preprocessing parameters corresponding to each heterogeneous type for subsequent preprocessing of each image patch can avoid various problems caused by a one-size-fits-all preprocessing approach, such as over-enhancement, under-enhancement, and insufficient information due to excessive smoothing. This can reduce the learning difficulty of deep learning segmentation models, allowing them to focus more on recognizing the biological morphology of cells and improve segmentation accuracy.
[0060] Optionally, determining the heterogeneous preprocessing parameters corresponding to each heterogeneous type includes:
[0061] From the plurality of image blocks, select representative image blocks for each heterogeneous type;
[0062] For any of the representative image blocks, based on the current preprocessing parameters, the current preprocessing parameters are gradually adjusted during the current iteration to obtain the preprocessing adjustment parameters;
[0063] Based on the preprocessing adjustment parameters, the representative image patch is segmented to obtain the number of cell segments corresponding to the preprocessing adjustment parameters. The preprocessing adjustment parameters are then used as the current preprocessing parameters, and the iteration continues until the iteration termination condition is met. The preprocessing parameters corresponding to the maximum number of cell segments are then used as the heterogeneous preprocessing parameters for the heterogeneous type corresponding to the representative image patch.
[0064] In this embodiment, a representative image patch for a heterogeneous type refers to an image patch that can represent that type of heterogeneity. If multiple image patches exist for a given heterogeneous type, the image patch with the largest heterogeneous region area can be selected as the representative image patch. The heterogeneous preprocessing parameters corresponding to a heterogeneous type represent the optimal preprocessing parameters suitable for the heterogeneous region of that type. For example, if there are 5 image patches, and 3 of these 5 image patches represent heterogeneous types, 3 representative image patches are selected, with one representative image patch corresponding to each heterogeneous type. For a heterogeneous type, the representative image patch corresponding to that heterogeneous type is segmented into cells without preprocessing, and then a random restart hill-climbing algorithm is used to find the optimal preprocessing parameters corresponding to that heterogeneous type.
[0065] For each heterogeneity type, an iterative method is used to find the optimal preprocessing parameters for that type. The current preprocessing parameters represent the preprocessing parameters in the current iteration. During each iteration, the preprocessing parameters are progressively adjusted to obtain the adjusted preprocessing parameters. For example, the preprocessing parameters can be adjusted widely initially, then gradually, until the optimal preprocessing parameters are found. During each iteration, iterative evaluation metrics are used to assess whether the adjusted preprocessing parameters are optimal. These metrics include the number of cell segments. If the adjusted preprocessing parameters are not optimal, the iteration continues, updating the adjusted parameters to the current preprocessing parameters, and the iteration continues until the iteration termination condition is met.
[0066] The specific search process includes the following steps: initialization, local search, evaluation, selection, and iteration termination. The initialization step sets the maximum number of restarts and the maximum number of iterations per hill-climbing iteration. In the local search step, cell segmentation is performed without preprocessing, and then the contrast, brightness, gamma, hue, and saturation values are gradually adjusted. In the evaluation step, the number of cell segments in each movement direction is evaluated. Preprocessing parameters are first adjusted broadly, then finely, until the optimal preprocessing parameters are found. In the selection step, the iteration evaluation metric is the number of cells obtained; the preprocessing parameters that yield the most cells are considered the optimal preprocessing parameters. In the iteration termination step, the maximum number of iterations is set. If the maximum number of iterations is reached and the number of cell segments does not significantly improve, the search stops and the current preprocessing parameters are returned. For example, selecting three representative image patches and performing the above steps to find the optimal preprocessing parameters on each patch can yield three types of heterogeneous preprocessing parameters.
[0067] In the above embodiments, preprocessing parameters for image blocks are determined based on the recognition results. When the recognition results indicate that multiple image blocks do not have heterogeneous regions, a set of uniform preprocessing parameters is determined. When the recognition results indicate that one or more of the image blocks have heterogeneous regions, heterogeneous preprocessing parameters corresponding to each heterogeneous type in the recognition results are determined. In this way, each heterogeneous type corresponds to a set of optimal preprocessing parameters, which facilitates the subsequent preprocessing of each image block by using these optimal preprocessing parameters corresponding to each heterogeneous type. This avoids using a single preprocessing parameter to process non-uniform image blocks, which reduces the segmentation difficulty of the subsequent deep learning segmentation model, allowing the deep learning segmentation model to focus more on recognizing the biological morphology of cells and improve segmentation accuracy.
[0068] In some embodiments, the preprocessing parameter data includes heterogeneous preprocessing parameters corresponding to each heterogeneous type. Preprocessing is performed on each image block according to the preprocessing parameter data to obtain preprocessed image data corresponding to each image block, including:
[0069] For any image block, the image block is preprocessed using the heterogeneous preprocessing parameters corresponding to each heterogeneous type to obtain preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters. The preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters are used as the preprocessed image data corresponding to the image block.
[0070] In this embodiment, for each image block, heterogeneous preprocessing parameters corresponding to each heterogeneous type are used for processing. For example, if there are 5 image blocks, and 3 of these 5 image blocks contain 3 heterogeneous types, then there will be 3 sets of heterogeneous preprocessing parameters corresponding to 3 heterogeneous types. For each image block, these 3 sets of heterogeneous preprocessing parameters are used for preprocessing. By processing the 5 image blocks using this method, 5 × 3 preprocessed image blocks can be obtained. Each image block corresponds to three processed image blocks.
[0071] In the above embodiments, each image patch is preprocessed using a set of optimal preprocessing parameters corresponding to each heterogeneous type, avoiding the use of a single preprocessing parameter to process uneven image patches. This reduces the segmentation difficulty of the subsequent deep learning segmentation model, allowing the deep learning segmentation model to focus more on recognizing the biological morphology of cells and improve segmentation accuracy.
[0072] In some embodiments, obtaining each cell region in the whole-slice image based on the segmentation results of each of the image patches includes:
[0073] For any of the image blocks, the segmentation result of the image block includes preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters. Each preprocessed image block corresponds to a segmentation layer. Based on the overlapping data of the predicted cell contours in each segmentation layer, image fusion is performed to obtain the target cell segmentation result of the image block.
[0074] Based on the target cell segmentation results of each image block, each cell region in the whole slice image is obtained.
[0075] In this embodiment, for the same image patch, N heterogeneous preprocessing parameters of different types are used for optimization to obtain N preprocessed image patches. These N preprocessed image patches are then input into a deep learning segmentation model to obtain N distinct segmentation layers. Each layer contains predicted cell contours from its own viewpoint. For example, if there are 5 image patches with 3 heterogeneous types, each image patch will have three corresponding segmentation layers. Therefore, there are 15 segmentation layers for the 5 image patches. For the N segmentation layers of the same image patch, the predicted contour of a certain cell in that image patch may be predicted in how many segmentation layers, and the boundary positions of the predicted contours of the same cell will differ across different segmentation layers.
[0076] Optionally, the step of performing image fusion based on the overlapping data of the predicted cell contours in each segmentation layer to obtain the target cell segmentation result of the image patch includes:
[0077] For any cell prediction contour in any segmentation layer, when the cell prediction contour does not overlap with the cell prediction contour in the comparison layer, the cell prediction contour is determined as the target cell contour.
[0078] When the predicted cell contour overlaps with the contrast cell contour of the contrast layer, the centroid of the predicted cell contour and the centroid of the contrast cell contour are calculated, and the target cell contour is determined based on the centroid of the predicted cell contour and the centroid of the contrast cell contour.
[0079] In this embodiment, a predicted cell contour in any segmentation layer of the same image patch is compared with predicted cell contours in a comparison layer. The comparison layer refers to all segmentation layers other than the current segmentation layer. For example, if an image patch has three segmentation layers, and the currently processed segmentation layer is the first layer, then the comparison layers are the second and third layers. When a predicted cell contour does not overlap with predicted cell contours in other layers, that predicted cell contour is determined to be the target cell contour.
[0080] In this embodiment, when the predicted cell outline overlaps with the contrasting cell outline of other layers, the centroid of the predicted cell outline can be calculated based on the coordinate data of the predicted cell outline, and the centroid of the contrasting cell outline can be calculated based on the coordinate data of the contrasting cell outline.
[0081] Optionally, determining the target cell contour based on the centroid of the predicted cell contour and the centroid of the contrasting cell contour includes:
[0082] When the centroid of the predicted cell contour is within the region of the contrasting cell contour, and the centroid of the contrasting cell contour is within the region of the predicted cell contour, the predicted cell contour and the contrasting cell contour are fused into a target cell contour.
[0083] When the centroid of the predicted cell contour is not within the region of the contrasting cell contour, and / or the centroid of the contrasting cell contour is within the region of the predicted cell contour, a new dividing line is created based on the intersection of the predicted cell contour and the contrasting cell contour to obtain two target cell contours.
[0084] In this embodiment, the predicted cell contours between segmentation layers may overlap. If the centroids of the overlapping predicted cell contours are within each other's area, then the overlapping predicted cell contours are merged into a single target cell contour. For example, if a first predicted cell contour A is in the first segmentation layer and a second predicted cell contour B is in the second segmentation layer, where predicted cell contours A and B overlap, and the centroid of predicted cell contour A is within the area of predicted cell contour B, and the centroid of predicted cell contour B is within the area of predicted cell contour A, then predicted cell contours A and B are merged into a single target cell contour based on their boundaries.
[0085] If the predicted cell outlines overlap between segmentation layers, and the centroids of the overlapping predicted cell outlines are not within each other's area range, then a new segmentation line is created between the two outlines to avoid overlap. For example, if the first predicted cell outline A is on the first segmentation layer and the second predicted cell outline B is on the second segmentation layer, and predicted cell outlines A and B overlap, and the centroid of predicted cell outline A is not within the area range of predicted cell outline B, while the centroid of predicted cell outline B is within the area range of predicted cell outline A, then a new segmentation line is created based on the intersection of predicted cell outlines A and B, resulting in two target cell outlines.
[0086] For the same image patch, process the predicted contours of each cell in each segmentation layer according to the steps described above. Perform the same processing steps for each segmentation layer of other image patches. Figure 4 As shown, Figure 4 This is a schematic diagram illustrating the segmentation results after performing cell segmentation on two image blocks in a whole-slice image using different preprocessing parameters in one embodiment. Figure 4 Condition 1 corresponds to a heterogeneous preprocessing parameter for one type of heterogeneity, and condition 2 corresponds to a heterogeneous preprocessing parameter for another type of heterogeneity. Figure 4 The leftmost part of the table shows the segmentation results for the two image patches after preprocessing them separately using Condition 1. The segmented cell count of 13451 is the sum of the cell counts obtained after preprocessing the two image patches separately using the heterogeneous preprocessing parameters corresponding to one type of heterogeneity in Condition 1. Figure 4 The middle part represents the segmentation results for the two image patches after preprocessing them separately using Condition 2. The enhanced segmentation cell count of 25359 represents the sum of the cell counts obtained after preprocessing the two image patches separately using the heterogeneous preprocessing parameters corresponding to another heterogeneous type of Condition 2. Figure 4The rightmost part of the image shows the individual cell regions in the fused full-slice image. The number of cells after fusion, 33162, represents the number of cells after fusing the segmentation results corresponding to condition one and condition two of the two image patches. For cells with low contrast and blurred boundaries, segmentation with a single preprocessing parameter may fail. However, using multiple sets of heterogeneous preprocessing parameters may enhance the features of the region, allowing it to be successfully segmented and contributed to the final result during the fusion stage. For the same image patch, fusion is performed based on the segmentation results of different segmentation layers. For example, for the same image patch, segmentation layer A obtained after preprocessing the image patch with one preprocessing parameter has more complete segmentation in dense areas, while segmentation layer B obtained after preprocessing the image patch with another preprocessing parameter has better edge cell detection. Fusing segmentation layer A and segmentation layer B can reflect the advantages of each layer, resulting in higher segmentation accuracy.
[0087] In the above embodiments, for each segmentation layer of the same image patch, fusion is performed based on the overlap of the predicted cell contours in each segmentation layer. This enables the segmented cells to have high confidence, and random noise or local artifacts are unlikely to cause the same incorrect segmentation in all preprocessing paths. The true cellular structure can be stably detected in multiple preprocessing paths. The fusion based on the overlap data of the predicted cell contours in each segmentation layer has the ability to reduce noise and remove artifacts, thereby improving the accuracy of cell segmentation.
[0088] In another aspect, this application provides a computer program product, including a computer program that, when executed by a processor, implements the cell segmentation method based on spatial omics sequencing as described in any embodiment of this application.
[0089] In the computer program product, the optional implementation form of the program module architecture of the computer program that implements each step of the cell segmentation method based on spatial omics sequencing can be a cell segmentation device based on spatial omics sequencing.
[0090] Please see Figure 5One embodiment of this application provides a cell segmentation device based on spatial omics sequencing, comprising: an acquisition module 51 for acquiring a collected whole-slice image, wherein the whole-slice image indicates the distribution characteristics of spatial omics signals in the tissue slice; an identification module 52 for dividing the whole-slice image into blocks to obtain multiple image blocks, identifying whether heterogeneous regions exist in the multiple image blocks, and obtaining identification results; a preprocessing module 53 for preprocessing each image block according to the identification results to obtain preprocessed image data corresponding to each image block; a segmentation module 54 for forming the input of a deep learning segmentation model based on the preprocessed image data corresponding to each image block, and outputting the segmentation results of each image block through the deep learning segmentation model; and a fusion module 55 for obtaining each cell region in the whole-slice image based on the segmentation results of each image block.
[0091] Optionally, the preprocessing module 53 is also used for:
[0092] Based on the identification results, determine the preprocessing parameter data;
[0093] Based on the preprocessing parameter data, each of the image blocks is preprocessed to obtain preprocessed image data corresponding to each of the image blocks.
[0094] Optionally, the preprocessing module 53 is also used for:
[0095] When the recognition result indicates that there are no heterogeneous regions in the multiple image blocks, a set of uniform preprocessing parameters is determined;
[0096] When the recognition result indicates that one or more of the image blocks contain heterogeneous regions, the heterogeneous preprocessing parameters corresponding to each heterogeneous type in the recognition result are determined.
[0097] Optionally, the preprocessing module 53 is also used for:
[0098] From the plurality of image blocks, select representative image blocks for each heterogeneous type;
[0099] For any of the representative image blocks, based on the current preprocessing parameters, the current preprocessing parameters are gradually adjusted during the current iteration to obtain the preprocessing adjustment parameters;
[0100] Based on the preprocessing adjustment parameters, the representative image patch is segmented to obtain the number of cell segments corresponding to the preprocessing adjustment parameters. The preprocessing adjustment parameters are then used as the current preprocessing parameters, and the iteration continues until the iteration termination condition is met. The preprocessing parameters corresponding to the maximum number of cell segments are then used as the heterogeneous preprocessing parameters for the heterogeneous type corresponding to the representative image patch.
[0101] Optionally, the preprocessing parameter data includes heterogeneous preprocessing parameters corresponding to each heterogeneous type. Based on the preprocessing parameter data, the segmentation module 54 is further configured to:
[0102] For any image block, the image block is preprocessed using the heterogeneous preprocessing parameters corresponding to each heterogeneous type to obtain preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters. The preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters are used as the preprocessed image data corresponding to the image block.
[0103] Optionally, the fusion module 55 is also used for:
[0104] For any of the image blocks, the segmentation result of the image block includes preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters. Each preprocessed image block corresponds to a segmentation layer. Based on the overlapping data of the predicted cell contours in each segmentation layer, image fusion is performed to obtain the target cell segmentation result of the image block.
[0105] Based on the target cell segmentation results of each image block, each cell region in the whole slice image is obtained.
[0106] Optionally, the fusion module 55 is also used for:
[0107] For any cell prediction contour in any segmentation layer, when the cell prediction contour does not overlap with the cell prediction contour in the comparison layer, the cell prediction contour is determined as the target cell contour.
[0108] When the predicted cell contour overlaps with the contrast cell contour of the contrast layer, the centroid of the predicted cell contour and the centroid of the contrast cell contour are calculated, and the target cell contour is determined based on the centroid of the predicted cell contour and the centroid of the contrast cell contour.
[0109] Optionally, the fusion module 55 is further configured to determine the target cell contour based on the centroid of the predicted cell contour and the centroid of the contrasting cell contour, including:
[0110] When the centroid of the predicted cell contour is within the region of the contrasting cell contour, and the centroid of the contrasting cell contour is within the region of the predicted cell contour, the predicted cell contour and the contrasting cell contour are fused into a target cell contour.
[0111] When the centroid of the predicted cell contour is not within the region of the contrasting cell contour, and / or the centroid of the contrasting cell contour is within the region of the predicted cell contour, a new dividing line is created based on the intersection of the predicted cell contour and the contrasting cell contour to obtain two target cell contours.
[0112] It will be understood by those skilled in the art that Figure 5 The structure of the cell segmentation device based on space omics sequencing does not constitute a limitation on the device itself. Each module can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in hardware or independently of the controller in the computing device, or stored in software in the memory of the computing device, so that the controller can invoke and execute the operations corresponding to each module. In other embodiments, the cell segmentation device based on space omics sequencing may include more or fewer modules than those shown in the figure.
[0113] Please see Figure 6 In another aspect of this application, a computing device 20 is also provided, including a memory 3011 and a processor 3012. The memory 3011 stores a computer program, which, when executed by the processor, causes the processor 3012 to perform the steps of the cell segmentation method based on spatial omics sequencing provided in any of the above embodiments of this application. The computing device may include a desktop computer, laptop computer, tablet computer, handheld computer, smart speaker, server, etc., mobile phone (e.g., smartphone, cordless phone, etc.), wearable device (e.g., a pair of smart glasses or a smartwatch), or similar device.
[0114] The processor 3012 is the control center, connecting various parts of the computing device via various interfaces and lines. It executes software programs and / or modules stored in the memory 3011, and calls data stored in the memory 3011 to perform various functions and process data. Optionally, the processor 3012 may include one or more processing cores; the processor 3012 includes, but is not limited to, one or more combinations of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), Field-Programmable Gate Array (FPGA), etc. Preferably, the processor 3012 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user page, and applications, and the modem processor mainly handles wireless communication. It is understood that the aforementioned modem processor may not be integrated into the processor 3012.
[0115] The memory 3011 can be used to store software programs and modules. The processor 3012 executes various functional applications and data processing by running the software programs and modules stored in the memory 3011. The memory 3011 may mainly include a program storage area and a data storage area. The program storage area may store the operating system, application programs required for at least one function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the computing device, etc. In addition, the memory 3011 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device. Accordingly, the memory 3011 may also include a memory controller to provide the processor 3012 with access to the memory 3011.
[0116] In another aspect, this application also provides a storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the steps of the cell segmentation method based on spatial omics sequencing provided in any of the above embodiments of this application.
[0117] Those skilled in the art will understand that all or part of the processes in the methods provided in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0118] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. The scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A cell segmentation method based on space omics sequencing, characterized in that, include: Acquire whole-slice images, which indicate the distribution characteristics of spatial omics signals in tissue slices; The full slice image is divided into blocks to obtain multiple image blocks. The presence of heterogeneous regions in the multiple image blocks is identified to obtain the identification results. Based on the identification results, determine the preprocessing parameter data; Based on the preprocessing parameter data, each image block is preprocessed to obtain preprocessed image data corresponding to each image block. The preprocessing parameter data includes heterogeneous preprocessing parameters corresponding to each heterogeneous type. The step of preprocessing each image block based on the preprocessing parameter data to obtain preprocessed image data corresponding to each image block includes: for any image block, using heterogeneous preprocessing parameters corresponding to each heterogeneous type to preprocess the image block respectively, to obtain preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters, and using the preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters as the preprocessed image data corresponding to the image block. Based on the preset processed image data corresponding to each of the image blocks, the input of the deep learning segmentation model is formed, and the segmentation result of each of the image blocks is output through the deep learning segmentation model; Based on the segmentation results of each image block, each cell region in the whole slice image is obtained.
2. The cell segmentation method based on space omics sequencing as described in claim 1, characterized in that, The step of determining the preprocessing parameter data based on the recognition result includes: When the recognition result indicates that there are no heterogeneous regions in the multiple image blocks, a set of uniform preprocessing parameters is determined; When the recognition result indicates that one or more of the image blocks contain heterogeneous regions, the heterogeneous preprocessing parameters corresponding to each heterogeneous type in the recognition result are determined.
3. The cell segmentation method based on space omics sequencing as described in claim 2, characterized in that, The determination of the heterogeneity preprocessing parameters corresponding to each heterogeneity type in the identification results includes: From the plurality of image blocks, select representative image blocks for each heterogeneous type; For any of the representative image blocks, based on the current preprocessing parameters, the current preprocessing parameters are gradually adjusted during the current iteration to obtain the preprocessing adjustment parameters; Based on the preprocessing adjustment parameters, the representative image patch is segmented to obtain the number of cell segments corresponding to the preprocessing adjustment parameters. The preprocessing adjustment parameters are then used as the current preprocessing parameters, and the iteration continues until the iteration termination condition is met. The preprocessing parameters corresponding to the maximum number of cell segments are then used as the heterogeneous preprocessing parameters for the heterogeneous type corresponding to the representative image patch.
4. The cell segmentation method based on space omics sequencing as described in claim 1, characterized in that, The process of obtaining each cell region in the whole-slice image based on the segmentation results of each of the image patches includes: For any of the image blocks, the segmentation result of the image block includes preprocessed image blocks corresponding to each set of heterogeneous preprocessing parameters. Each preprocessed image block corresponds to a segmentation layer. Based on the overlapping data of the predicted cell contours in each segmentation layer, image fusion is performed to obtain the target cell segmentation result of the image block. Based on the target cell segmentation results of each image block, each cell region in the whole slice image is obtained.
5. The cell segmentation method based on space omics sequencing as described in claim 4, characterized in that, The step of performing image fusion based on the overlapping data of the predicted cell contours in each segmentation layer to obtain the target cell segmentation result of the image block includes: For any cell prediction contour in any segmentation layer, when the cell prediction contour does not overlap with the cell prediction contour in the comparison layer, the cell prediction contour is determined as the target cell contour. When the predicted cell contour overlaps with the contrast cell contour of the contrast layer, the centroid of the predicted cell contour and the centroid of the contrast cell contour are calculated, and the target cell contour is determined based on the centroid of the predicted cell contour and the centroid of the contrast cell contour.
6. The cell segmentation method based on space omics sequencing as described in claim 5, characterized in that, Determining the target cell contour based on the centroid of the predicted cell contour and the centroid of the contrasting cell contour includes: When the centroid of the predicted cell contour is within the region of the contrasting cell contour, and the centroid of the contrasting cell contour is within the region of the predicted cell contour, the predicted cell contour and the contrasting cell contour are fused into a target cell contour. When the centroid of the predicted cell contour is not within the region of the contrasting cell contour, and / or the centroid of the contrasting cell contour is within the region of the predicted cell contour, a new dividing line is created based on the intersection of the predicted cell contour and the contrasting cell contour to obtain two target cell contours.
7. A computing device, characterized in that, The method includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as described in any one of claims 1 to 6.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, the processor performs the steps of the method as described in any one of claims 1 to 6.
9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Abnormal cell detection and segmentation method, device and equipment and storage medium
CN114399494A