Nucleus bright field image virtual staining method based on deep learning, terminal device and storage medium
Patent Information
- Application Number
- CN202610671302.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-05-15
- Publication Date
- 2026-09-25
AI Technical Summary
尽管以U-Net为代表的全卷积网络在一定程度上实现了虚拟染色,但受限于卷积操作固有的局部感受野(Local Receptive Field),此类纯CNN架构难以有效捕捉图像中的长距离依赖关系和全局上下文信息
本发明以细胞明场显微成像为基础,摒弃了传统的化学荧光标记手段,利用深度学习技术实现了从无标记明场图像到高保真荧光图像的跨模态生成。所述方法在构建明场-荧光配对数据集的基础上,创新性地采用结合了深度卷积神经网络ResNet-50与视觉Vision Transformer的混合架构R50-ViT-B_16作为核心生成模型,针对细胞显微图像细节丰富且分辨率高的特点,本发明将模型输入尺寸标准化为512×512,并针对性地将Transformer模块的网格参数调整为(32, 32),使其精准适配ResNet前端下采样后的特征图维度;该架构不仅利用ResNet-50有效提取了细胞核边缘的局部纹理特征,更利用VisionTransformer的多头自注意力机制捕捉了细胞在全局视野下的分布规律,有效解决了传统U-Net模型在处理密集细胞或复杂背景时容易出现的分割粘连与伪影问题。
Smart Images

Figure CN122820894A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image staining technology, and more specifically, to a deep learning-based virtual staining method, terminal device, and storage medium for bright-field images of cell nuclei. Background Technology
[0002] In cell biology, pathological diagnosis, and drug development, the morphology, size, and distribution characteristics of the cell nucleus are key indicators for assessing cellular physiological status, identifying lesions (such as in cancer screening), and analyzing drug toxicity. Currently, the "gold standard" method for observing cell nuclei in the biomedical field is fluorescence chemical staining. This technique typically utilizes specific fluorescent dyes such as 4',6-diamidinyl-2-phenylindole (DAPI) or Hoechst. These dyes can embed themselves in the deep grooves of the DNA double helix structure and emit bright blue fluorescence when excited by specific wavelengths (such as ultraviolet light), thereby achieving high-contrast imaging and localization of the cell nucleus.
[0003] However, traditional fluorescent chemical staining methods have several significant limitations in practical applications. First, most chemical dyes possess varying degrees of cytotoxicity; their DNA embedding process can interfere with normal cell replication and transcription, and even induce apoptosis, making this method unsuitable for continuous monitoring of precious cell samples or long-term dynamic physiological processes in living cells. Second, fluorescence imaging relies on high-intensity excitation light sources; prolonged exposure not only causes phototoxic damage to living cells but also induces chemical bleaching of fluorescent chromophores (photobleaching), leading to rapid signal decay over time and severely impacting the persistence and stability of observations. Furthermore, the fluorescent staining procedure is cumbersome, typically involving fixation, permeation, incubation, and multiple washing steps, which is time-consuming and complex. Combined with the high cost of fluorescence microscopes and specific dyes, this significantly limits its widespread application in primary healthcare institutions or large-scale rapid sample screening.
[0004] As an alternative, bright-field microscopy offers significant advantages such as being label-free, non-phototoxic, and simple to operate, preserving the natural physiological state of cells to the greatest extent possible. However, because cells are phase objects, their absorption of visible light is extremely weak, resulting in very low contrast between the cell nucleus, cytoplasm, and background under bright-field microscopy. Furthermore, the internal structures of the cells appear transparent with blurred edges. In cases of high cell density or adherent growth, accurate identification and segmentation of the cell nucleus cannot be achieved using only the human eye or traditional image processing algorithms (such as thresholding and edge detection), failing to meet the needs of refined quantitative analysis.
[0005] In recent years, with the rapid development of deep learning technology, "virtual staining" technology based on convolutional neural networks (CNNs) has emerged, aiming to learn the nonlinear mapping relationship from bright-field images to fluorescence images through data-driven methods. Although fully convolutional networks, represented by U-Net, have achieved virtual staining to some extent, they are limited by the inherent local receptive field of convolution operations. Such pure CNN architectures struggle to effectively capture long-range dependencies and global contextual information in images. When processing complex backgrounds or densely cellular regions, issues such as lost cell nucleus texture, discontinuous edge segmentation, and misidentification of background impurities as cell nuclei often occur, resulting in image fidelity that still needs improvement.
[0006] Publication No. CN108319815B discloses a method and system for virtual cell staining. This method establishes a prediction model based on first staining information to predict second staining information through machine learning, and performs virtual staining on cell staining images based on the prediction results of the prediction model, and superimposes the results onto the cell staining images. Its core idea is to derive one staining channel from one real staining channel and complete the channel conversion by relying on the labeled staining signal. It does not involve a virtual fluorescence staining method for unlabeled bright-field images. Summary of the Invention
[0007] To address the aforementioned technical problems, this invention provides a method for virtual staining of bright-field images of cell nuclei based on deep learning, a terminal device, and a storage medium.
[0008] To achieve the above objectives, the present invention adopts the following technical solution: A deep learning-based virtual staining method for bright-field images of cell nuclei includes the following steps: S1. Collect fluorescence staining channel images and bright field channel images of cells under the same field of view to construct a dataset; S2. Perform dilatational erosion morphological processing on the dataset to generate binary mask data pairs that correspond one-to-one with the bright field images, which are used as training labels for the deep learning model. S3. Based on the R50-ViT-B_16 architecture of the pre-trained deep learning model TransUNet, a bright field cell segmentation model is constructed by training the dataset. S4. Test the images generated by the bright-field cell segmentation model to verify the effectiveness of the model in extracting features; S5. Establish an interactive interface, which includes an input window and an output window. Input the bright-field cell image to be stained in the input window, output the prediction mask using the constructed bright-field cell segmentation model, and output the virtual fluorescence staining image after image processing.
[0009] Further, step S1 specifically involves: selecting HeLa cells as the experimental subject and culturing them in 1640 medium containing 10% fetal bovine serum and 1% penicillin-dextrose antibody; incubating the cells with a Hoechst 34580 probe at a concentration of 5-10 μg / mL for 10-20 minutes; and simultaneously acquiring fluorescence channel images and bright field channel images in the same field of view using a confocal laser scanning microscope equipped with a 60x oil immersion objective; wherein the excitation / emission wavelength of the fluorescence channel is set to 405 / 450±50 nm, the image resolution is 1024×1024, and the bit depth is 12 bits.
[0010] Further, in step S2, the specific method of dilation and erosion preprocessing is as follows: the original fluorescent staining image is binarized to generate an initial mask; small noise in the background is removed using morphological opening operation; the connectivity of the cell nucleus region is enhanced by morphological dilation operation to fill the voids inside the cell nucleus; the boundaries of the adhered cell nuclei are separated by morphological erosion operation, and finally, binary mask data pairs corresponding one-to-one with the bright field image are generated.
[0011] Furthermore, in step S3, the network architecture of R50-ViT-B_16 includes: a hybrid encoder, which uses a ResNet-50 network to extract shallow spatial features of the image and uses a multi-head self-attention mechanism through the Vision Transformer module to extract global contextual features of the image to solve the problems of low contrast of cell nuclei and complex background in bright-field images; and a cascaded decoder, which adopts a cascaded upsampling structure of the U-Net architecture and fuses the high-resolution features extracted by the hybrid encoder with the features of the decoder through skip connections to restore the edge morphology of the cell nucleus.
[0012] Further, in step S3, the training parameters of the model are configured as follows: the size of the input bright field image is standardized to 512×512 pixels; for this input size, the grid parameters of the Vision Transformer module are set to (32, 32) to match the dimension of the feature map after downsampling by the ResNet front end, ensuring that the pre-trained weights are loaded correctly; the number of output channels of the model is set to 1, the loss function is a weighted combination of binary cross-entropy loss and Dice Loss, the optimizer is SGD or Adam, the momentum is set to 0.9, and multiple iterations are performed until the loss converges.
[0013] Further, in step S4, structural similarity, mean square error, and peak signal-to-noise ratio are used to evaluate the model; the specific steps of the structural similarity test are as follows: normalize the predicted image generated by the model and the real label image to the [0, 1] interval respectively; use a sliding window to calculate the similarity of the two images in the three dimensions of brightness, contrast, and structure; calculate the mean structural similarity of the whole image, and when the quantization value is close to 1, it is determined that the model has effectively extracted the features of bright field cells.
[0014] Furthermore, the specific methods in step S5 include: inference and inversion processing: after the model outputs the prediction mask, a black-and-white inversion operation is performed to set the background to dark and the cell nucleus to light; threshold-gated noise reduction: a brightness threshold is set to force the background noise area with pixel values lower than the brightness threshold to zero in order to eliminate artifacts in non-cellular areas; pseudo-color mapping: a three-channel color image is constructed, and the noise-reduced grayscale values are mapped to the blue channel to simulate the DAPI fluorescence staining effect.
[0015] Furthermore, in step S5, the interactive interface is also provided with interactive slider one and interactive slider two. Interactive slider one can adjust the background brightness weight of the output virtual fluorescence staining image; interactive slider two can adjust the fluorescence intensity weight of the output virtual fluorescence staining image.
[0016] As an inventive concept, the present invention also provides a terminal device, comprising: an image acquisition interface, a memory, a processor, and a display module; the image acquisition interface is used to receive bright-field images of cells; the memory is used to store a computer program that implements the above method; the processor is used to run the computer program stored in the memory; and the display module is used to display the generated virtual fluorescence staining image and GUI operation interface to the user.
[0017] As an inventive concept, the present invention also provides a storage medium storing a computer program / instructions, which are executed by a processor to perform the above-described deep learning-based virtual staining method for bright-field images of cell nuclei.
[0018] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention, based on bright-field cell microscopy, abandons traditional chemical fluorescence labeling methods and utilizes deep learning technology to achieve cross-modal generation from label-free bright-field images to high-fidelity fluorescence images. The method innovatively employs a hybrid architecture, R50-ViT-B_16, combining a deep convolutional neural network ResNet-50 with a visual Vision Transformer, as the core generation model, building upon a bright-field-fluorescence paired dataset. Addressing the rich detail and high resolution of cell microscopy images, this invention standardizes the model input size to 512×512 and specifically adjusts the grid parameters of the Transformer module to (32, 32) to precisely adapt to the feature map dimensions after downsampling by the ResNet front-end. This architecture not only effectively extracts local texture features of cell nucleus edges using ResNet-50 but also captures the distribution patterns of cells in the global field of view using the multi-head self-attention mechanism of VisionTransformer, effectively solving the segmentation adhesion and artifact problems that easily occur in traditional U-Net models when dealing with dense cells or complex backgrounds.
[0019] Furthermore, this invention establishes an interactive interface and performs a series of image processing steps on the model's output prediction mask, including black-and-white inversion, threshold-gated noise reduction, and pseudo-color mapping, transforming the model's output probability map into a blue fluorescence image that highly reproduces the DAPI staining effect. Simultaneously, the interactive interface allows real-time adjustment of the bright-field background brightness weight and fluorescence intensity weight, enabling image overlay display. Users can freely adjust the transparency ratio of the bright-field background and the virtual fluorescence layer, greatly improving the convenience of image analysis.
[0020] Compared with traditional chemiluminescence staining techniques, the method proposed in this invention has several significant advantages: it avoids phototoxicity and cytotoxicity, is simpler to operate, and is less expensive. This method eliminates approximately one hour of staining preparation steps and does not require the use of exogenous dyes, thereby minimizing interference with the natural physiological state of living cells. Therefore, this technology provides an efficient, intelligent, and more physiologically accurate solution for long-term, non-destructive imaging analysis of living cells and precise pathological diagnosis. Attached Figure Description
[0021] Figure 1 This is a flowchart of the steps of the deep learning-based virtual staining method for bright-field images of cell nuclei in this invention; Figure 2 A comparison image of cell nuclei under bright-field and dark-field fluorescence conditions; Figure 3 This is a comparison image of cell nuclei in dark-field fluorescence and after corrosion and expansion. Figure 4 This is the architecture diagram of the R50-ViT-B_16 model; Figure 5 Image showing the predicted cell nuclei of bright-field cells using the R50-ViT-B_16 model; Figure 6 The SSIM, MSE, and PSNR metrics and the difference plot for the prediction test plot of the R50-ViT-B_16 model; Figure 7 This is a schematic diagram of the interactive interface in Example 1.
[0022] Figure 8 The results were obtained using A549 cells as the experimental subjects. Detailed Implementation
[0023] To clearly illustrate the technical features of this solution, the invention will be described in detail below through specific implementation methods and in conjunction with the accompanying drawings.
[0024] Many specific details are set forth in the following description in order to provide a full understanding of this application. However, this application may also be implemented in other ways different from those described herein. Therefore, the scope of protection of this application is not limited to the specific embodiments disclosed below.
[0025] In this invention, unless otherwise expressly specified and limited, the first feature "on" or "below" the second feature may be in direct contact with the first and second features, or indirect contact through an intermediate medium. In the description of this specification, references to terms such as "an embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0026] Example 1 Please see Figures 1 to 8 This embodiment provides a deep learning-based virtual staining method for bright-field images of cell nuclei, comprising the following steps: S1. Collect fluorescence staining channel images and bright field channel images of cells under the same field of view to construct a dataset; S2. Perform dilatational erosion morphological processing on the dataset to generate binary mask data pairs that correspond one-to-one with the bright field images, which are used as training labels for the deep learning model. S3. Based on the R50-ViT-B_16 architecture of the pre-trained deep learning model TransUNet, a bright field cell segmentation model is constructed by training the dataset. S4. Test the images generated by the bright-field cell segmentation model to verify the effectiveness of the model in extracting features; S5. Establish an interactive interface, which includes an input window and an output window. Input the bright-field cell image to be stained in the input window, output the prediction mask using the constructed bright-field cell segmentation model, and output the virtual fluorescence staining image after image processing.
[0027] The process of Embodiment 1 of the present invention will be described in detail below through specific embodiments, covering environment setup, data preparation, model building, performance evaluation and interactive interface.
[0028] 1. Environment and Hardware Setup Environment: The code in this embodiment runs on the PyTorch deep learning framework, with Python 3.10 as the primary programming language. Torchvision is used for image preprocessing and transformation, OpenCV-Python and SciPy are used for morphological operations, and PyQt5 is used to develop the graphical user interface.
[0029] Hardware: Model training and inference were performed on a computer workstation equipped with a high-performance NVIDIA GeForce RTX 3090 GPU, 64GB RAM and an Intel(R) Xeon(R) W-2245 CPU to ensure efficient computation of the TransUNet architecture.
[0030] 2. Material and Data Preprocessing 2.1 Cell Culture and Image Acquisition Considering the stability of data acquisition, the maturity of culture conditions, and the consistency of imaging during the experimental validation phase, HeLa cells were selected as the experimental subject and cultured in 1640 medium containing 10% fetal bovine serum and 1% penicillin-dextrose antibody. After the cells reached a suitable level of confluence, they were incubated with Hoechst 34580 nuclear staining probes at a concentration of 5–10 μg / mL for 10–20 minutes. The imaging equipment used was a Nikon A1plus confocal laser scanning microscope equipped with a 60x oil immersion objective. At an excitation wavelength of 405 nm and an emission wavelength of 450 ± 50 nm, DAPI fluorescence channel images and bright-field (TD) channel images were simultaneously acquired in the same field of view, such as… Figure 2 As shown, the image resolution is uniformly 1024×1024 pixels, and the bit depth is 12 bits.
[0031] 2.2 Label Generation and Morphological Preprocessing Because the original fluorescence images suffer from background fluorescence interference and uneven signal distribution within cell nuclei, directly using them as "ground values" for training leads to a decrease in model segmentation accuracy. This embodiment performs dilation and erosion morphological processing on the dataset, as shown in the following example. Figure 3 As shown, the specific method of dilation and erosion preprocessing is as follows: First, the original fluorescence image is binarized to generate an initial mask; then, morphological opening operation is used to remove small noise points in the background; subsequently, morphological dilation operation is used to enhance the connectivity of the cell nucleus region, effectively filling the voids inside the cell nucleus; finally, morphological erosion operation is used to separate the slightly adhered cell nucleus boundaries. The processed binary mask and the corresponding brightfield image constitute a high-quality "brightfield-binary mask" data pair for subsequent supervised learning.
[0032] 3. Construction and parameter configuration of the bright-field cell segmentation model This invention uses TransUNet (R50-ViT-B_16) as the core generative model, and its architecture is as follows: Figure 4 As shown. This hybrid architecture combines the advantages of ResNet-50 and Vision Transformer, and its network architecture includes: Hybrid Encoder: It uses ResNet-50 to extract shallow spatial features (such as cell edge texture) from bright field images, and then uses the Vision Transformer module to extract global contextual features through a multi-head self-attention mechanism to solve the problem of low contrast in bright field images.
[0033] Cascaded Decoder: Employs a cascaded upsampling structure based on the U-Net architecture, fusing high-resolution features through skip connections to restore the morphology of cell nuclei edges.
[0034] Model training parameter configuration: To adapt to the features of microscopic images, the input bright-field image size is standardized to 512×512 pixels. For this size, the grid parameter of the Vision Transformer is forced to be set to (32, 32) to accurately match the dimension of the feature map after downsampling by the ResNet front end. The model output channel is set to 1, the loss function is a weighted combination of binary cross-entropy loss (BCE Loss) and Dice Loss, the optimizer is SGD or Adam, the momentum is set to 0.9, and multiple iterations are performed until the loss converges.
[0035] 4. Performance Evaluation and Experimental Results 4.1 Evaluation Indicators Structural similarity (SSIM), mean squared error (MSE), and peak signal-to-noise ratio (PSNR) were used as quantitative metrics to verify the effectiveness of the model in extracting features. SSIM measures the similarity between the generated image and the ground truth label in terms of brightness, contrast, and structure (closer to 1 is better); MSE measures pixel-level error (lower is better); and PSNR measures the reconstruction quality of the image (higher is better).
[0036] 4.2 Quantitative Results Analysis like Figure 5 and Figure 6 As shown, the model performs excellently on the test set. Figure 5 The results demonstrate a high degree of consistency between the input brightfield image, the model's output predicted mask, and the ground truth label. Figure 6 Quantitative analysis results show that, compared with the baseline, the prediction results of the model of this invention have an SSIM as high as 0.9689, an MSE of only 709.00, and a PSNR of 19.62 dB. The difference map further shows that the prediction error is mainly concentrated in the extremely fine areas of the cell edge, while the restoration of the main structure of the cell nucleus is extremely high, demonstrating the effectiveness of the R50-ViT-B_16 architecture in extracting bright-field cell features.
[0037] 5. Development of the interactive interface To facilitate the application of the algorithm, this embodiment is built based on PyQt, as follows: Figure 7 and Figure 8 The interactive interface shown demonstrates simulated staining of HeLa cells and A549 cells.
[0038] Users can upload a bright-field cell image by clicking "Input Bright-Field Image" and then load a prediction image by clicking "Load Prediction Image". The constructed bright-field cell segmentation model will output a prediction mask, which will be processed to display a virtual fluorescent staining image. The specific steps of the image processing include: performing a black-and-white inversion operation on the black-and-white mask output by the model to set the background to dark and the cell nucleus to light; then forcing the background noise areas with pixel values below the brightness threshold to zero to eliminate artifacts in non-cellular areas; then constructing a three-channel color image and mapping the denoised grayscale values to the blue channel to simulate the DAPI fluorescent staining effect.
[0039] The interactive interface is equipped with two interactive sliders. The first interactive slider can adjust the background brightness weight of the output virtual fluorescence staining image, and the second interactive slider can adjust the fluorescence intensity weight of the output virtual fluorescence staining image. This allows for real-time adjustment of the bright field background brightness weight and fluorescence intensity weight, enabling image overlay display and facilitating simultaneous observation of cell morphology and nuclear localization.
[0040] The deep learning-based virtual staining method for bright-field images of cell nuclei provided in this embodiment offers a significant advantage over traditional chemical staining (which takes more than an hour and is phototoxic). This invention provides rapid simulation imaging, eliminates the need for users to handle toxic dyes or expensive fluorescence microscopes, and allows for the acquisition of high-fidelity virtual fluorescence observation results with just one bright-field image, greatly reducing experimental costs and time.
[0041] Example 2 Embodiment 2 of the present invention provides a terminal device corresponding to Embodiment 1 above. The terminal device can be a processing device for a client, such as a laptop, tablet computer, desktop computer, etc., to execute the method of the above embodiments.
[0042] The terminal device in this embodiment includes a memory, a processor, and a computer program stored in the memory; the processor executes the computer program in the memory to implement the steps of the method in Embodiment 1 described above.
[0043] In some implementations, the memory may be high-speed random access memory (RAM), and may also include non-volatile memory, such as at least one disk storage device.
[0044] In other implementations, the processor can be any type of general-purpose processor, such as a central processing unit (CPU) or a digital signal processor (DSP), and there is no limitation here.
[0045] Example 3 Embodiment 3 of the present invention provides a computer-readable storage medium corresponding to Embodiment 1 above, on which a computer program / instructions are stored. When the computer program / instructions are executed by a processor, they implement the steps of the method of Embodiment 1 above.
[0046] A computer-readable storage medium can be a tangible device that holds and stores instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any combination thereof.
[0047] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively describe all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the claims of the present invention.
Claims
1. A deep learning-based virtual staining method for bright-field images of cell nuclei, characterized in that, Includes the following steps: S1. Collect fluorescence staining channel images and bright field channel images of cells under the same field of view to construct a dataset; S2. Perform dilatational erosion morphological processing on the dataset to generate binary mask data pairs that correspond one-to-one with the bright field images, which are used as training labels for the deep learning model. S3. Based on the R50-ViT-B_16 architecture of the pre-trained deep learning model TransUNet, a bright field cell segmentation model is constructed by training the dataset. S4. Test the images generated by the bright-field cell segmentation model to verify the effectiveness of the model in extracting features; S5. Establish an interactive interface, which includes an input window and an output window. Input the bright-field cell image to be stained in the input window, output the prediction mask using the constructed bright-field cell segmentation model, and output the virtual fluorescence staining image after image processing.
2. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, Step S1 specifically involves: selecting HeLa cells as the experimental subject and culturing them in 1640 medium containing 10% fetal bovine serum and 1% penicillin-dextrose antibody; incubating the cells with Hoechst 34580 probe at a concentration of 5-10 μg / mL for 10-20 minutes. Using a confocal laser scanning microscope equipped with a 60x oil immersion objective, fluorescence channel images and bright field channel images were simultaneously acquired in the same field of view; wherein, the excitation wavelength / emission wavelength of the fluorescence channel was set to 405 / 450±50 nm, the resolution of the image was 1024×1024, and the bit depth was 12 bits.
3. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, In step S2, the specific method of dilation erosion preprocessing is as follows: the original fluorescent staining image is binarized to generate an initial mask; small noise in the background is removed using morphological opening operation; and the connectivity of the cell nucleus region is enhanced by morphological dilation operation to fill the voids inside the cell nucleus. Morphological erosion is used to separate the boundaries of adhered cell nuclei, ultimately generating binary mask data pairs that correspond one-to-one with the brightfield image.
4. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, In step S3, the network architecture of R50-ViT-B_16 includes: a hybrid encoder, which uses a ResNet-50 network to extract shallow spatial features of the image and uses a multi-head self-attention mechanism through the Vision Transformer module to extract global contextual features of the image to solve the problems of low contrast of cell nuclei and complex background in bright field images; and a cascaded decoder, which adopts a cascaded upsampling structure of U-Net architecture and fuses the high-resolution features extracted by the hybrid encoder with the features of the decoder through skip connections to restore the edge morphology of the cell nucleus.
5. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 4, characterized in that, In step S3, the training parameters of the model are configured as follows: the size of the input bright field image is normalized to 512×512 pixels; for this input size, the grid parameters of the Vision Transformer module are set to (32, 32) to match the dimension of the feature map after downsampling by the ResNet front end, ensuring that the pre-trained weights are loaded correctly; the number of output channels of the model is set to 1, the loss function is a weighted combination of binary cross-entropy loss and Dice Loss, the optimizer is SGD or Adam, the momentum is set to 0.9, and multiple iterations are performed until the loss converges.
6. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, In step S4, structural similarity, mean squared error, and peak signal-to-noise ratio are used to evaluate the model; the specific steps of the structural similarity test are as follows: normalize the predicted image generated by the model and the real label image to the [0, 1] interval respectively; The similarity between two images in three dimensions—brightness, contrast, and structure—is calculated using a sliding window. Calculate the mean structural similarity of the entire image. When the quantization value is close to 1, it is determined that the model has effectively extracted the features of bright-field cells.
7. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, The specific methods in step S5 include: inference and inversion processing: after the model outputs the prediction mask, a black-and-white inversion operation is performed to set the background to dark and the cell nucleus to light; threshold-gated denoising: a brightness threshold is set to force the background noise area with pixel values lower than the brightness threshold to zero in order to eliminate artifacts in non-cellular areas; pseudo-color mapping: a three-channel color image is constructed, and the denoised grayscale values are mapped to the blue channel to simulate the DAPI fluorescence staining effect.
8. The method for virtual staining of bright-field images of cell nuclei based on deep learning according to claim 1, characterized in that, In step S5, the interactive interface is further provided with interactive slider one and interactive slider two. Interactive slider one can adjust the background brightness weight of the output virtual fluorescence staining image; interactive slider two can adjust the fluorescence intensity weight of the output virtual fluorescence staining image.
9. A terminal device, characterized in that, include: Image acquisition interface, memory, processor, display module; The image acquisition interface is used to receive bright-field images of cells; The memory is used to store a computer program that implements the method according to any one of claims 1 to 8; the processor is used to run the computer program stored in the memory; The display module is used to display the generated virtual fluorescence staining image and GUI operation interface to the user.
10. A storage medium, characterized in that, The storage medium stores a computer program / instruction, which, when executed by a processor, implements the deep learning-based virtual staining method for bright-field images of cell nuclei as described in any one of claims 1 to 8.
Citation Information
Patent Citations
A method and system for virtual cell staining
CN108319815B