Method for virtual staining super-resolution reconstruction of unstained histopathological sections
By constructing a dual-generator dual-discriminator network, the problems of low resolution and deformation in lensless computational microscopy were solved, and end-to-end mapping from low-resolution holograms to high-resolution H&E staining was achieved, improving the accuracy and efficiency of pathological diagnosis.
Patent Information
- Application Number
- CN202611277778.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-21
- Publication Date
- 2026-11-24
AI Technical Summary
Existing lensless computational microscopy techniques face problems such as low resolution, weak alignment interference, and cumulative errors in cascaded schemes when generating high-fidelity H&E images, making it difficult to meet the needs of pathological diagnosis.
By constructing a reconstruction network with dual generators and dual discriminators, and combining multi-module feature processing and deformation compensation, an end-to-end mapping from low-resolution label-free holograms to high-resolution virtual H&E staining maps is achieved. The network is jointly trained using adversarial, recurrent, and pixel-based multiple loss methods to solve the spatial resolution limitation and deformation problem.
It significantly improves the morphological restoration, spatial alignment accuracy, and diagnostic reliability in virtual staining tasks using holographic images, and is suitable for label-free digital pathological examination and real-time intraoperative auxiliary diagnosis.
Smart Images

Figure CN123160347A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and medical image processing technology, specifically relating to a virtual staining super-resolution reconstruction method for unstained tissue pathological sections. Background Technology
[0002] Histological assessment based on hematoxylin and eosin (H&E) staining is currently the core basis for clinical pathological diagnosis. However, traditional chemical staining procedures are cumbersome and time-consuming, making it difficult to meet the needs of rapid decision-making in emergencies or intraoperative procedures, and they also cause irreversible damage to biological tissues, limiting the subsequent reuse of valuable samples. Although existing image processing technologies have made progress in the conversion between different chemical staining modalities, these methods still cannot escape the cumbersome operation and tissue damage caused by physical staining processes.
[0003] In recent years, label-free computational imaging techniques, represented by lensless computational microscopy, have attracted much attention due to their ability to non-destructively acquire tissue biophysical features. However, the holograms obtained after lensless computational microscopy lack the color and contrast information familiar to pathologists, making them difficult to use directly for pathological diagnosis. Therefore, realizing cross-modal virtual staining from label-free holographic modalities to standard staining modalities has significant practical implications.
[0004] However, compared to color conversion between traditional chemical staining modalities, generating high-fidelity H&E images directly from holograms faces the following technical bottlenecks: First, spatial resolution limitations: Lensless computational microscopy resolution is limited by the pixel size of the sensor, resulting in low resolution and difficulty in presenting the subcellular microscopic details required for pathological diagnosis.
[0005] Second, weak alignment interference during the sampling process: In the process of constructing a hologram and a real H&E image pair, due to structural differences in physical continuous slices or chemical deformation caused by staining, there are non-rigid deformations and spatial position deviations between the two modal images. Previous deep learning models lacked the ability to tolerate morphological deviations when processing this type of weakly aligned data, and were prone to producing problems such as edge artifacts and structural distortions in the generated results.
[0006] Third, the accumulation of errors in cascaded schemes: If a simple cascaded scheme of virtual staining followed by super-resolution reconstruction is adopted, it will not only increase the computational complexity, but also cause artifacts in the cross-modal conversion process to be amplified in the subsequent super-resolution enhancement stage, resulting in image distortion. If a cascaded scheme of super-resolution reconstruction followed by virtual staining is adopted, interference noise in the hologram will inevitably be amplified during super-resolution, thus misleading the staining network to fabricate incorrect tissue textures. Summary of the Invention
[0007] The purpose of this invention is to provide a virtual staining super-resolution reconstruction method for unstained tissue pathological sections, realizing end-to-end mapping of unstained sections from low-resolution label-free holograms to high-resolution virtual H&E staining maps.
[0008] The technical solution adopted in this invention is a virtual staining super-resolution reconstruction method for unstained tissue pathological sections, which is implemented according to the following steps: Step 1, Preprocessing: Acquire the holographic sequence of the slice and the corresponding H&E staining image, obtain the phase map through phase operation, register the slice blocks to remove bad images, and build a high- and low-resolution paired training set; Step 2: Construct a reconstruction network containing two generators and two discriminators; Step 3: The low-resolution phase map is fed into the forward generator, and after multi-module feature processing, deformation compensation and sub-pixel magnification, a high-definition virtual color map is generated. Step 4: Train the network using adversarial, recurrent, and pixel-based multi-loss methods to lock the parameters of the forward generator; Step 5: Input the phase map to be tested into the trained network and output a high-resolution virtual H&E staining map.
[0009] The invention is further characterized in that, The specific steps are as follows: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. Step 3, Virtual staining super-resolution reconstruction: The low-resolution phase image patch obtained in Step 1 is input into the forward generator. Tissue morphology features are extracted through the shallow feature extraction unit and the downsampling encoding unit. Long-range dependencies between different tissue structures are established through the residual feature enhancement unit and the global relation enhancement spatial modeling unit. The offset and modulation weight of the pixel sampling position are predicted through the deformable spatial correction unit to compensate for the spatial position deviation and non-rigid deformation between the phase image and the H&E staining image. Finally, the sub-pixel super-resolution reconstruction unit performs 2x scale amplification to generate a high-resolution virtual H&E staining image. Step 4, Network Training and Parameter Optimization: A generative adversarial training path is constructed using the phase image domain discriminator and the H&E staining image domain discriminator. A cyclic consistency transformation path is constructed using the forward generator and the inverse generator. An end-to-end training of the virtual staining super-resolution reconstruction network is performed using a joint loss function composed of adversarial loss, cyclic consistency loss, and super-resolution pixel consistency loss. After training, the network parameters of the forward generator are fixed. Step 5: Virtual staining image generation: Input the phase image of the unstained tissue pathology section to be processed into the trained forward generator, and output the corresponding high-resolution virtual H&E staining image.
[0010] In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previously aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method, resulting in a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central regions. The two-dimensional translation between the simulated holographic image and the current original holographic image is calculated using a Fourier phase correlation sub-pixel registration algorithm based on normalized cross-power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation, completing the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of each height original holographic image after alignment is normalized, and converted into the corresponding measurement amplitude based on the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measurement amplitude of the first acquisition plane and zero initial phase. A multi-height bidirectional cross-platform registration algorithm based on angular spectrum propagation is then used. The alternative projection phase recovery method involves propagating the complex optical field sequentially in the forward and backward directions between multiple acquisition planes. At each acquisition plane, the phase of the currently calculated complex optical field is retained, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Next, the phase distribution is unwrapped in two dimensions, and a Gaussian filter is used to obtain the low-frequency background phase. The unwrapped phase distribution is then subtracted from the low-frequency background phase, and after percentile truncation, linear normalization, and grayscale inversion, a standardized black-and-white phase map is obtained. Finally, the standardized black-and-white phase map is registered with the corresponding H&E-stained full scan image using an affine transformation. A sliding window sampling method with overlapping regions is used to simultaneously cut the registered standardized black-and-white phase map and the H&E-stained full scan image. Blank areas and invalid image blocks located at the registration edges are removed based on the grayscale mean and grayscale standard deviation of each image block, resulting in M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
[0011] Step 1 is implemented in the following steps: The workflow for constructing the sample is as follows: Step 1.1: Let the original holographic image sequence read be... ,in , representing the grayscale image captured at the nth height, with Using a reference coordinate system, sub-pixel alignment of the entire image sequence is achieved by calculating the spatial translation vector between adjacent frames and performing geometric transformations. Let the previously aligned image be... Based on the physical distance difference between adjacent shooting planes The image that has already been aligned in the previous frame. Projecting onto the current height plane yields a simulated hologram. , means as follows:
[0012] In the formula, Let be the transfer function for propagation in free space. and These represent the two-dimensional Fourier transform and the two-dimensional inverse Fourier transform, respectively. wavelength of the light source This represents the difference in axial distance between the previous acquisition plane and the current acquisition plane. These represent the spatial frequency coordinates in the horizontal and vertical directions, respectively. The current image to be aligned... The simulated reconstructed image corresponding to the current acquisition plane is obtained. Phase correlation calculations are performed to obtain the subpixel shift between the two images, and the cross-power spectrum is obtained. , means as follows:
[0013] By searching The peak position determines the subpixel translation vector. Using this vector pair Perform bilinear interpolation translation transformation to obtain the aligned image. ; Step 1.2: Read the holographic intensity image of the first acquisition plane after spatial alignment completed in Step 1.1. The initial light field is constructed using the intensity-amplitude relationship formula. :
[0014] This represents the normalized measured amplitude of the first acquisition plane. The image shows the holographic intensity image of the first acquisition plane.
[0015] The reconstructed complex optical field corresponding to each candidate propagation distance was calculated using the angular spectrum backpropagation algorithm:
[0016] Amplitude images corresponding to each reconstructed complex light field are extracted, the Sobel operator is used to calculate the gradient of the amplitude images, and the sharpness of the images corresponding to each candidate propagation distance is evaluated using the gradient Gini coefficient.
[0017] In the formula, Indicates the firsti The gradient Gini coefficients corresponding to the propagation distances of each candidate are... This represents the gradient magnitude of the corresponding reconstructed amplitude image. The candidate propagation distance with the largest gradient Gini coefficient is used as the initial recommended focal position. By interactively browsing through various candidate reconstructed images, the propagation distance corresponding to the clearest reconstructed image selected by the operator is ultimately determined as the focal position.
[0018] Step 1.3: Utilizing the intensity constraints of multiple acquisition planes, the complete complex amplitude information of the sample is recovered through an alternating projection iterative algorithm. The GS (Gerchberg-Saxton) algorithm is used to propagate the light field cyclically between N measurement planes. At each measurement plane n, the phase of the currently calculated light field is retained. The amplitude was obtained by converting the measured hologram. Replace constraints:
[0019] The updated light field will then be... The propagation continues to the next measurement surface n + 1. After iterative convergence, the complex optical field is propagated back to the object plane to extract the initial phase distribution. To address the phase wrapping problem, an unwrapping algorithm is used to recover continuous phase, and a Gaussian filter is used to construct a background model for background subtraction to eliminate system noise and low-frequency fringes.
[0020] In the formula, This represents the phase distribution after removing low-frequency background. This represents the continuous phase distribution after two-dimensional phase unwrapping. The standard deviation is A two-dimensional Gaussian filter kernel is used, and finally a standardized black-and-white phase map is generated by contrast stretching. Step 1.4: Select corresponding feature control points on the phase full image and H&E full scan image, and calculate the affine mapping matrix. ,use The H&E image is geometrically transformed and resampled to align the transformed H&E image with the initial spatial alignment of the phase map in the macroscopic coordinate system.
[0021] In the formula, ( ) represents the coordinates of the control points in the H&E staining full scan image; ) represents the corresponding coordinates after affine mapping; This represents the affine transformation matrix calculated from the corresponding feature control points.
[0022] A sliding window with a fixed step size is used to simultaneously cut the registered dual-domain large image, and a fixed proportion of overlapping area is set to increase sample diversity and reduce boundary information loss. Calculate image statistics for the segmented image patches and classify them using a threshold discrimination method:
[0023] Invalid "waste blocks" containing blank areas, overexposure, or registration edge artifacts are removed, ultimately generating a set of valid paired blocks. .
[0024] In the formula, This represents the average grayscale value of the current image patch; This represents the standard deviation of the grayscale values of the current image patch; and These represent the lower and upper limits of the average grayscale threshold, respectively; Indicates the image texture discrimination threshold; Indicates the first One effective phase image block; Indicates the first H&E staining image blocks corresponding to each effective phase image block.
[0025] The single-channel effective phase image block is copied three times along the channel dimension to construct a three-channel phase image block, which is then used as input to the subsequent virtual staining super-resolution reconstruction network.
[0026] In step 2, a generative network model based on global relation enhancement and spatial alignment is constructed to achieve deep feature fusion and mapping from holographic phase features to pathological staining morphology. First, the input phase block is downsampled and encoded through cascaded strided convolutional layers to extract deep semantic features containing tissue morphology information. Then, a multi-head self-attention operation within a local window is performed using a global relation enhancement spatial modeling module to enhance the model's global understanding of complex pathological backgrounds by establishing long-range dependencies between tissue structures. Next, a deformable spatial correction unit is introduced to predict pixel-level dynamic offset fields and weight masks in parallel, and a sampling point compensation mechanism is used to eliminate non-rigid deformation between the phase map and the staining map, ensuring accurate alignment of the feature space at the physical scale. Finally, channel recombination and scale augmentation are performed through sub-pixel convolutional layers at the end to map the features to the high-magnification staining image domain, ultimately outputting a high-fidelity virtual staining preliminary result.
[0027] Step 2 is implemented in the following steps: Step 2.1: Extract the effective phase image block obtained in Step 1. An input reflection fill layer is used to fill the image boundaries with a width of 3 to eliminate convolution edge effects; then, using... The convolutional kernel performs feature mapping with a stride of 1 and performs non-linear mapping through the ReLU activation function, mapping the input space to a shallow feature space with 64 channels; Step 2.2: Perform two consecutive downsampling operations on the shallow features. Each operation includes a convolutional kernel with a size of [missing value]. A strided convolutional layer with a stride of 2 is followed by instance normalization and the LeakyReLU activation function; through this step, the feature map scale is reduced from... Down to Meanwhile, the number of channels was expanded from 64 to 256, enabling preliminary compression modeling of the global semantics of the image; Step 2.3: Input the downsampled features into the feature enhancement sequence consisting of 6 residual blocks. Each residual block contains two... A convolutional layer and a skip connection path are used to define the input features as follows: Output features , means as follows:
[0028] In the formula, ( () indicates a convolution operation with a kernel size of 3×3; ( ) indicates instance normalization operation; ( ) represents the linear rectification activation function; Represents input features; This step represents the output features. It extracts deep texture features from pathological tissues using a residual learning mechanism. Step 2.4: The feature input channel adaptation module after residual enhancement uses a convolutional layer with a kernel size of 1×1 to linearly map the features, compressing the number of feature channels from 256 to 128. This reduces the computational complexity of subsequent window self-attention while preserving semantic information as much as possible, providing a unified input dimension for the global relation enhancement module.
[0029] Step 2.5: First, perform LayerNorm normalization on the channel-adapted features to stabilize the feature distribution; then, divide the features into multiple non-overlapping local windows according to a fixed window size to establish input units for subsequent windowed multi-head self-attention calculation.
[0030] Step 2.6: Perform windowed multi-head self-attention operation within each local window, and perform linear mapping on the input features to obtain the query matrix. Key matrix K Sum matrix VThe attention weights between pixels within the window are calculated using the query matrix, key matrix, and value matrix. The calculation process is as follows:
[0031] In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Represents the learnable relative position bias matrix; Indicates matrix transpose; This represents the normalization function. By establishing long-range dependencies between different tissue structures through windowed self-attention, the global expressive power of complex pathological tissue morphology is improved.
[0032] Step 2.7: Input the windowed self-attention output features into the residual refinement module. The residual refinement module includes a LayerNorm normalization layer, a convolutional layer with a kernel size of 3×3, and residual connection paths. It further fuses the features after global relation enhancement and restores local details, thereby improving the ability to express tissue edges and texture details.
[0033] Step 2.8: Input the refined residual features into the progressive upsampling module and perform two upsampling operations consecutively. Each upsampling operation doubles the spatial resolution of the feature map and gradually restores shallow spatial details, so that the feature map size is restored from 64×64 to 256×256, and the fusion of shallow texture information and deep semantic information is completed.
[0034] Step 2.9: Input the recovered high-resolution features into the deformable spatial correction module, use convolution branches to predict the sampling offset and modulation weights corresponding to the deformable convolution, perform irregular position sampling on the feature map according to the sampling offset, and perform spatial compensation for the local non-rigid deformation caused by continuous tissue slicing and staining process to achieve local structural alignment between the phase map and the H&E staining map.
[0035] Step 2.10: Input the spatially corrected features into the PixelShuffle super-resolution reconstruction module. Complete the 2x super-resolution reconstruction by pixel rearrangement, and restore the 256×256 feature map to a 512×512 high-resolution feature map. This restores the tissue cell edge and fine-grained texture information while avoiding interpolation artifacts.
[0036] Step 2.11: Input the high-resolution features output by the PixelShuffle module into the output convolutional layer with a kernel size of 7×7 to complete feature mapping and color space restoration, and output a high-resolution virtual H&E staining image with a size of 3×512×512 through the Tanh activation function.
[0037] In step 3, a multi-criteria loss function is used to perform joint constraint training on the generator network. Adversarial learning, cycle consistency constraints, and super-resolution reconstruction supervision are used to jointly optimize the network parameters, achieving high-quality virtual stained images. First, an asymmetric generative adversarial training mechanism is constructed between the generator and the discriminator to drive the generator to learn the texture distribution features of real H&E stained images. Then, a cyclic mapping path is established from the phase map domain (domain A) to the H&E stained map domain (domain B) and back to the phase map domain (domain A), using cycle consistency loss to constrain the consistency of tissue structure during cross-modal transformation. Furthermore, a super-resolution reconstruction loss based on high-resolution real H&E stained images is introduced to provide pixel-level supervision of the generator output, improving the detail recovery capability of the virtual stained images. Finally, the Adam optimization algorithm is used to jointly optimize the various losses, and the trained generator model parameters are saved after model convergence. This model is then deployed as a virtual stained inference model to achieve end-to-end reconstruction from the original holographic image to a high-resolution H&E virtual stained image.
[0038] Step 3 is implemented in the following steps: Step 3.1: The virtual staining super-resolution generator constructed in Step 2 is trained adversarially using a CycleGAN bidirectional generative adversarial network. The generator... Used to implement the mapping from the phase map domain (domain A) to the H&E staining map domain (domain B); generator Used to achieve the inverse mapping from the H&E staining map domain (B domain) to the phase map domain (A domain); discriminator Used to determine the authenticity between generated virtual H&E staining images and real H&E staining images; discriminator Used to determine the consistency between the reconstructed phase map and the true phase map. The virtual staining image generated in step 2... Compared with real H&E staining images Input discriminator The discriminator extracts spatial distribution features through consecutive convolutional layers and outputs a true / false probability map; the generator is computed. The adversarial loss guides the generator to learn the texture distribution features of the stained domain:
[0039] In the formula, For the input phase image patch, For real H&E staining image patches; This represents a virtual H&E staining image generated by the generator; ( ) represents the probability of the discriminator output being true.
[0040] Step 3.2: Establish a cyclic mapping path from the phase map domain (domain A) to the H&E staining map domain (domain B) and back to the phase map domain (domain A), and generate a high-resolution virtual H&E staining image. Input reverse generator The inverse generator first performs a 2x downsampling to restore the image to its phase. Figure 1 To achieve the desired spatial resolution, reverse feature extraction and image reconstruction are then performed, outputting a reconstructed phase map. Reconstructing the phase map through calculation With the original input The pixel-level absolute error between them constrains the consistency of the organizational structure during the cyclic mapping process:
[0041] Step 3.3: For the high-resolution virtual H&E staining image output in Step 2.11, use the high-resolution real H&E staining image constructed in Step 1. As a supervisory label, the spatial consistency loss between the generated image and the real high-resolution image is calculated, providing accurate pixel-level guidance for the sub-pixel convolutional layers at the end of the network:
[0042] Step 3.4: Construct the overall objective function for pathological diagnosis tasks. The adversarial, cyclic, and super-resolution losses mentioned above are then weighted and integrated:
[0043] in , , , The weight coefficients of each constraint term are used to calculate the gradient of the total loss with respect to the parameters of each layer in the network, including the attention coefficient of the global relation enhancement module and the offset field parameters of the spatial correction layer, providing a numerical basis for parameter updates. Step 3.5: Use the Adam optimizer to perform end-to-end training. In each iteration, use the backpropagation algorithm to transmit gradient information from the end loss layer to the front coding layer. By continuously correcting the network parameters, make the virtual staining results statistically close to the real pathological slides. Step 3.6: When the training process meets the preset convergence criterion, solidify the generator. The model parameters will be used to generate the generator after training. Parameters are fixed and will Deployed as a virtual staining inference model, this model can directly receive the real-time phase feature blocks processed in step 1 and automatically generate high-resolution H&E virtual staining images that conform to clinical diagnostic habits, thereby completing the end-to-end conversion task from the original hologram to the digital pathological image.
[0044] The beneficial effects of this invention are as follows: In the data preprocessing stage, the virtual staining super-resolution reconstruction method for unstained tissue pathological sections eliminates mechanical displacement errors at the source through sub-pixel fine alignment and iterative phase recovery mechanisms using multi-height holographic sequences, obtaining high-fidelity tissue complex amplitude phase information, thus providing a high-quality physical feature foundation for subsequent deep learning mapping. In the feature fusion and mapping stage, this invention constructs a global relational enhancement spatial modeling module, utilizing a cross-window self-attention mechanism to capture long-range dependency information of tissue structures, solving the problem of pathological semantic loss caused by the limited receptive field in traditional convolutional neural networks, and significantly enhancing the robustness of target representation in complex tissue backgrounds. In the spatial correction stage, by introducing deformable spatial correction units, pixel-level compensation of phase features and staining morphology features is achieved using dynamic offset field prediction, effectively solving the misalignment problem between holographic imaging and physical staining images caused by non-rigid deformation, and improving the accuracy of cross-modal conversion. During the model optimization phase, asymmetric cyclic consistency constraints and a sub-pixel-level super-resolution strong supervision mechanism are jointly employed for tuning. This achieves modality style transfer while forcibly constraining the detail accuracy of the generated images at a 2x super-resolution scale, ensuring that the virtual staining images maintain the fidelity of tissue details and microstructures while possessing the standard H&E style. This invention significantly improves the morphological restoration accuracy, spatial alignment precision, and diagnostic reliability in holographic image virtual staining tasks through multi-module collaborative enhanced modeling and end-to-end fusion inference. It is applicable to practical scenarios such as label-free digital pathology detection, real-time intraoperative auxiliary diagnosis, and biological science research. Attached Figure Description
[0045] Figure 1 This is a flowchart of the data preprocessing process of the present invention; Figure 2 This is a structural diagram of the network for the virtual staining super-resolution reconstruction method of unstained tissue pathological sections according to the present invention; Figure 3 This is a diagram of the generator structure in the virtual staining super-resolution reconstruction method for unstained tissue pathological sections of the present invention; Figure 4(a) is a real chromosome slice image; Figure 4(b) is the model output diagram. Detailed Implementation
[0046] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0047] Example 1 The flowchart of the virtual staining super-resolution reconstruction method for unstained tissue pathological sections of this invention is as follows: Figure 1 As shown, please follow these steps: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. Step 3, Virtual staining super-resolution reconstruction: The low-resolution phase image patch obtained in Step 1 is input into the forward generator. Tissue morphology features are extracted through the shallow feature extraction unit and the downsampling encoding unit. Long-range dependencies between different tissue structures are established through the residual feature enhancement unit and the global relation enhancement spatial modeling unit. The offset and modulation weight of the pixel sampling position are predicted through the deformable spatial correction unit to compensate for the spatial position deviation and non-rigid deformation between the phase image and the H&E staining image. Finally, the sub-pixel super-resolution reconstruction unit performs 2x scale amplification to generate a high-resolution virtual H&E staining image. Step 4, Network Training and Parameter Optimization: A generative adversarial training path is constructed using the phase image domain discriminator and the H&E staining image domain discriminator. A cyclic consistency transformation path is constructed using the forward generator and the inverse generator. An end-to-end training of the virtual staining super-resolution reconstruction network is performed using a joint loss function composed of adversarial loss, cyclic consistency loss, and super-resolution pixel consistency loss. After training, the network parameters of the forward generator are fixed. Step 5: Virtual staining image generation: Input the phase image of the unstained tissue pathology section to be processed into the trained forward generator, and output the corresponding high-resolution virtual H&E staining image.
[0048] Example 2 The virtual staining super-resolution reconstruction method for unstained tissue pathological sections of the present invention is implemented according to the following steps: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previously aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method, resulting in a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central regions. The two-dimensional translation between the simulated holographic image and the current original holographic image is calculated using a Fourier phase correlation sub-pixel registration algorithm based on normalized cross-power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation, completing the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of each height original holographic image after alignment is normalized, and converted into the corresponding measurement amplitude based on the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measurement amplitude of the first acquisition plane and zero initial phase. A multi-height bidirectional cross-platform registration algorithm based on angular spectrum propagation is then used. The alternative projection phase recovery method involves propagating the complex optical field sequentially in the forward and backward directions between multiple acquisition planes. At each acquisition plane, the phase of the currently calculated complex optical field is retained, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Next, the phase distribution is unwrapped in two dimensions, and a Gaussian filter is used to obtain the low-frequency background phase. The unwrapped phase distribution is then subtracted from the low-frequency background phase, and after percentile truncation, linear normalization, and grayscale inversion, a standardized black-and-white phase map is obtained. Finally, the standardized black-and-white phase map is registered with the corresponding H&E-stained full scan image using an affine transformation. A sliding window sampling method with overlapping regions is used to simultaneously cut the registered standardized black-and-white phase map and the H&E-stained full scan image. Blank areas and invalid image blocks located at the registration edges are removed based on the grayscale mean and grayscale standard deviation of each image block, resulting in M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
[0049] Example 3 Step 1 is implemented in the following steps: The workflow for constructing the sample is as follows: Step 1.1: Let the original holographic image sequence read be... ,in , representing the grayscale image captured at the nth height, with Using a reference coordinate system, sub-pixel alignment of the entire image sequence is achieved by calculating the spatial translation vector between adjacent frames and performing geometric transformations. Let the previously aligned image be... Based on the physical distance difference between adjacent shooting planes The image that has already been aligned in the previous frame. Projecting onto the current height plane yields a simulated hologram. , means as follows:
[0050] In the formula, Let be the transfer function for propagation in free space. and These represent the two-dimensional Fourier transform and the two-dimensional inverse Fourier transform, respectively. wavelength of the light source This represents the difference in axial distance between the previous acquisition plane and the current acquisition plane. These represent the spatial frequency coordinates in the horizontal and vertical directions, respectively. The current image to be aligned... The simulated reconstructed image corresponding to the current acquisition plane is obtained. Phase correlation calculations are performed to obtain the subpixel shift between the two images, and the cross-power spectrum is obtained. , means as follows:
[0051] By searching The peak position determines the subpixel translation vector. Using this vector pair Perform bilinear interpolation translation transformation to obtain the aligned image. ; Step 1.2: Read the holographic intensity image of the first acquisition plane after spatial alignment completed in Step 1.1. The initial light field is constructed using the intensity-amplitude relationship formula. :
[0052] This represents the normalized measured amplitude of the first acquisition plane. The image shows the holographic intensity image of the first acquisition plane.
[0053] The reconstructed complex optical field corresponding to each candidate propagation distance was calculated using the angular spectrum backpropagation algorithm:
[0054] Amplitude images corresponding to each reconstructed complex light field are extracted, the Sobel operator is used to calculate the gradient of the amplitude images, and the sharpness of the images corresponding to each candidate propagation distance is evaluated using the gradient Gini coefficient.
[0055] In the formula, Indicates the first i The gradient Gini coefficients corresponding to the propagation distances of each candidate are... This represents the gradient magnitude of the corresponding reconstructed amplitude image. The candidate propagation distance with the largest gradient Gini coefficient is used as the initial recommended focal position. By interactively browsing through various candidate reconstructed images, the propagation distance corresponding to the clearest reconstructed image selected by the operator is ultimately determined as the focal position.
[0056] Step 1.3: Utilizing the intensity constraints of multiple acquisition planes, the complete complex amplitude information of the sample is recovered through an alternating projection iterative algorithm. The GS (Gerchberg-Saxton) algorithm is used to propagate the light field cyclically between N measurement planes. At each measurement plane n, the phase of the currently calculated light field is retained. The amplitude was obtained by converting the measured hologram. Replace constraints:
[0057] The updated light field will then be... The propagation continues to the next measurement surface n + 1. After iterative convergence, the complex optical field is propagated back to the object plane to extract the initial phase distribution. To address the phase wrapping problem, an unwrapping algorithm is used to recover continuous phase, and a Gaussian filter is used to construct a background model for background subtraction to eliminate system noise and low-frequency fringes.
[0058] In the formula, This represents the phase distribution after removing low-frequency background. This represents the continuous phase distribution after two-dimensional phase unwrapping. The standard deviation is A two-dimensional Gaussian filter kernel is used, and finally a standardized black-and-white phase map is generated by contrast stretching. Step 1.4: Select corresponding feature control points on the phase full image and H&E full scan image, and calculate the affine mapping matrix. ,use The H&E image is geometrically transformed and resampled to align the transformed H&E image with the initial spatial alignment of the phase map in the macroscopic coordinate system.
[0059] In the formula, ( ) represents the coordinates of the control points in the H&E staining full scan image; ) represents the corresponding coordinates after affine mapping; This represents the affine transformation matrix calculated from the corresponding feature control points.
[0060] A sliding window with a fixed step size is used to simultaneously cut the registered dual-domain large image, and a fixed proportion of overlapping area is set to increase sample diversity and reduce boundary information loss. Calculate image statistics for the segmented image patches and classify them using a threshold discrimination method:
[0061] Invalid "waste blocks" containing blank areas, overexposure, or registration edge artifacts are removed, ultimately generating a set of valid paired blocks. .
[0062] In the formula, This represents the average grayscale value of the current image patch; This represents the standard deviation of the grayscale values of the current image patch; and These represent the lower and upper limits of the average grayscale threshold, respectively; Indicates the image texture discrimination threshold; Indicates the first One effective phase image block; Indicates the first H&E staining image blocks corresponding to each effective phase image block.
[0063] The single-channel effective phase image block is copied three times along the channel dimension to construct a three-channel phase image block, which is then used as input to the subsequent virtual staining super-resolution reconstruction network.
[0064] Example 4 The virtual staining super-resolution reconstruction method for unstained tissue pathological sections of the present invention is implemented according to the following steps: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previously aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method, resulting in a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central regions. The two-dimensional translation between the simulated holographic image and the current original holographic image is calculated using a Fourier phase correlation sub-pixel registration algorithm based on normalized cross-power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation, completing the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of each height original holographic image after alignment is normalized, and converted into the corresponding measurement amplitude based on the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measurement amplitude of the first acquisition plane and zero initial phase. A multi-height bidirectional cross-platform registration algorithm based on angular spectrum propagation is then used. The alternative projection phase recovery method involves propagating the complex optical field sequentially in the forward and backward directions between multiple acquisition planes. At each acquisition plane, the phase of the currently calculated complex optical field is retained, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Next, the phase distribution is unwrapped in two dimensions, and a Gaussian filter is used to obtain the low-frequency background phase. The unwrapped phase distribution is then subtracted from the low-frequency background phase, and after percentile truncation, linear normalization, and grayscale inversion, a standardized black-and-white phase map is obtained. Finally, the standardized black-and-white phase map is registered with the corresponding H&E-stained full scan image using an affine transformation. A sliding window sampling method with overlapping regions is used to simultaneously cut the registered standardized black-and-white phase map and the H&E-stained full scan image. Blank areas and invalid image blocks located at the registration edges are removed based on the grayscale mean and grayscale standard deviation of each image block, resulting in M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
[0065] Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. Combination Figure 2 , Figure 3 In step 2, a generative network model based on global relation enhancement and spatial alignment is constructed to achieve deep feature fusion and mapping from holographic phase features to pathological staining morphology. First, the input phase block is downsampled and encoded through cascaded strided convolutional layers to extract deep semantic features containing tissue morphology information. Then, a multi-head self-attention operation within a local window is performed using a global relation enhancement spatial modeling module to enhance the model's global understanding of complex pathological backgrounds by establishing long-range dependencies between tissue structures. Next, a deformable spatial correction unit is introduced to predict pixel-level dynamic offset fields and weight masks in parallel, and a sampling point compensation mechanism is used to eliminate non-rigid deformation between the phase map and the staining map, ensuring accurate alignment of the feature space at the physical scale. Finally, channel recombination and scale augmentation are performed through sub-pixel convolutional layers at the end to map the features to the high-magnification staining image domain, ultimately outputting a high-fidelity virtual staining preliminary result.
[0066] Step 2 is implemented in the following steps: Step 2.1: Extract the effective phase image block obtained in Step 1. An input reflection fill layer is used to fill the image boundaries with a width of 3 to eliminate convolution edge effects; then, using... The convolutional kernel performs feature mapping with a stride of 1 and performs non-linear mapping through the ReLU activation function, mapping the input space to a shallow feature space with 64 channels; Step 2.2: Perform two consecutive downsampling operations on the shallow features. Each operation includes a convolutional kernel with a size of [missing value]. A strided convolutional layer with a stride of 2 is followed by instance normalization and the LeakyReLU activation function; through this step, the feature map scale is reduced from... Down to Meanwhile, the number of channels was expanded from 64 to 256, enabling preliminary compression modeling of the global semantics of the image; Step 2.3: Input the downsampled features into the feature enhancement sequence consisting of 6 residual blocks. Each residual block contains two... A convolutional layer and a skip connection path are used to define the input features as follows: Output features , means as follows:
[0067] In the formula, ( () indicates a convolution operation with a kernel size of 3×3; ( ) indicates instance normalization operation; ( ) represents the linear rectification activation function; Represents input features; This step represents the output features. It extracts deep texture features from pathological tissues using a residual learning mechanism. Step 2.4: The feature input channel adaptation module after residual enhancement uses a convolutional layer with a kernel size of 1×1 to linearly map the features, compressing the number of feature channels from 256 to 128. This reduces the computational complexity of subsequent window self-attention while preserving semantic information as much as possible, providing a unified input dimension for the global relation enhancement module.
[0068] Step 2.5: First, perform LayerNorm normalization on the channel-adapted features to stabilize the feature distribution; then, divide the features into multiple non-overlapping local windows according to a fixed window size to establish input units for subsequent windowed multi-head self-attention calculation.
[0069] Step 2.6: Perform windowed multi-head self-attention operation within each local window, and perform linear mapping on the input features to obtain the query matrix. Key matrix K Sum matrix V The attention weights between pixels within the window are calculated using the query matrix, key matrix, and value matrix. The calculation process is as follows:
[0070] In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Represents the learnable relative position bias matrix; Indicates matrix transpose; This represents the normalization function. By establishing long-range dependencies between different tissue structures through windowed self-attention, the global expressive power of complex pathological tissue morphology is improved.
[0071] Step 2.7: Input the windowed self-attention output features into the residual refinement module. The residual refinement module includes a LayerNorm normalization layer, a convolutional layer with a kernel size of 3×3, and residual connection paths. It further fuses the features after global relation enhancement and restores local details, thereby improving the ability to express tissue edges and texture details.
[0072] Step 2.8: Input the refined residual features into the progressive upsampling module and perform two upsampling operations consecutively. Each upsampling operation doubles the spatial resolution of the feature map and gradually restores shallow spatial details, so that the feature map size is restored from 64×64 to 256×256, and the fusion of shallow texture information and deep semantic information is completed.
[0073] Step 2.9: Input the recovered high-resolution features into the deformable spatial correction module, use convolution branches to predict the sampling offset and modulation weights corresponding to the deformable convolution, perform irregular position sampling on the feature map according to the sampling offset, and perform spatial compensation for the local non-rigid deformation caused by continuous tissue slicing and staining process to achieve local structural alignment between the phase map and the H&E staining map.
[0074] Step 2.10: Input the spatially corrected features into the PixelShuffle super-resolution reconstruction module. Complete the 2x super-resolution reconstruction by pixel rearrangement, and restore the 256×256 feature map to a 512×512 high-resolution feature map. This restores the tissue cell edge and fine-grained texture information while avoiding interpolation artifacts.
[0075] Step 2.11: Input the high-resolution features output by the PixelShuffle module into the output convolutional layer with a kernel size of 7×7 to complete feature mapping and color space restoration, and output a high-resolution virtual H&E staining image with a size of 3×512×512 through the Tanh activation function.
[0076] Example 5 The virtual staining super-resolution reconstruction method for unstained tissue pathological sections of the present invention is implemented according to the following steps: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previously aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method, resulting in a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central regions. The two-dimensional translation between the simulated holographic image and the current original holographic image is calculated using a Fourier phase correlation sub-pixel registration algorithm based on normalized cross-power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation, completing the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of each height original holographic image after alignment is normalized, and converted into the corresponding measurement amplitude based on the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measurement amplitude of the first acquisition plane and zero initial phase. A multi-height bidirectional cross-platform registration algorithm based on angular spectrum propagation is then used. The alternative projection phase recovery method involves propagating the complex optical field sequentially in the forward and backward directions between multiple acquisition planes. At each acquisition plane, the phase of the currently calculated complex optical field is retained, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Next, the phase distribution is unwrapped in two dimensions, and a Gaussian filter is used to obtain the low-frequency background phase. The unwrapped phase distribution is then subtracted from the low-frequency background phase, and after percentile truncation, linear normalization, and grayscale inversion, a standardized black-and-white phase map is obtained. Finally, the standardized black-and-white phase map is registered with the corresponding H&E-stained full scan image using an affine transformation. A sliding window sampling method with overlapping regions is used to simultaneously cut the registered standardized black-and-white phase map and the H&E-stained full scan image. Blank areas and invalid image blocks located at the registration edges are removed based on the grayscale mean and grayscale standard deviation of each image block, resulting in M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
[0077] Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. In step 2, a generative network model based on global relation enhancement and spatial alignment is constructed to achieve deep feature fusion and mapping from holographic phase features to pathological staining morphology. First, the input phase block is downsampled and encoded through cascaded strided convolutional layers to extract deep semantic features containing tissue morphology information. Then, a multi-head self-attention operation within a local window is performed using a global relation enhancement spatial modeling module to enhance the model's global understanding of complex pathological backgrounds by establishing long-range dependencies between tissue structures. Next, a deformable spatial correction unit is introduced to predict pixel-level dynamic offset fields and weight masks in parallel, and a sampling point compensation mechanism is used to eliminate non-rigid deformation between the phase map and the staining map, ensuring accurate alignment of the feature space at the physical scale. Finally, channel recombination and scale augmentation are performed through sub-pixel convolutional layers at the end to map the features to the high-magnification staining image domain, ultimately outputting a high-fidelity virtual staining preliminary result.
[0078] Step 2 is implemented in the following steps: Step 2.1: Extract the effective phase image block obtained in Step 1. An input reflection fill layer is used to fill the image boundaries with a width of 3 to eliminate convolution edge effects; then, using... The convolutional kernel performs feature mapping with a stride of 1 and performs non-linear mapping through the ReLU activation function, mapping the input space to a shallow feature space with 64 channels; Step 2.2: Perform two consecutive downsampling operations on the shallow features. Each operation includes a convolutional kernel with a size of [missing value]. A strided convolutional layer with a stride of 2 is followed by instance normalization and the LeakyReLU activation function; through this step, the feature map scale is reduced from... Down to Meanwhile, the number of channels was expanded from 64 to 256, enabling preliminary compression modeling of the global semantics of the image; Step 2.3: Input the downsampled features into the feature enhancement sequence consisting of 6 residual blocks. Each residual block contains two... A convolutional layer and a skip connection path are used to define the input features as follows: Output features , means as follows:
[0079] In the formula, ( () indicates a convolution operation with a kernel size of 3×3; ( ) indicates instance normalization operation; ( ) represents the linear rectification activation function; Represents input features; This step represents the output features. It extracts deep texture features from pathological tissues using a residual learning mechanism. Step 2.4: The feature input channel adaptation module after residual enhancement uses a convolutional layer with a kernel size of 1×1 to linearly map the features, compressing the number of feature channels from 256 to 128. This reduces the computational complexity of subsequent window self-attention while preserving semantic information as much as possible, providing a unified input dimension for the global relation enhancement module.
[0080] Step 2.5: First, perform LayerNorm normalization on the channel-adapted features to stabilize the feature distribution; then, divide the features into multiple non-overlapping local windows according to a fixed window size to establish input units for subsequent windowed multi-head self-attention calculation.
[0081] Step 2.6: Perform windowed multi-head self-attention operation within each local window, and perform linear mapping on the input features to obtain the query matrix. Key matrix K Sum matrix V The attention weights between pixels within the window are calculated using the query matrix, key matrix, and value matrix. The calculation process is as follows:
[0082] In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Represents the learnable relative position bias matrix; Indicates matrix transpose; This represents the normalization function. By establishing long-range dependencies between different tissue structures through windowed self-attention, the global expressive power of complex pathological tissue morphology is improved.
[0083] Step 2.7: Input the windowed self-attention output features into the residual refinement module. The residual refinement module includes a LayerNorm normalization layer, a convolutional layer with a kernel size of 3×3, and residual connection paths. It further fuses the features after global relation enhancement and restores local details, thereby improving the ability to express tissue edges and texture details.
[0084] Step 2.8: Input the refined residual features into the progressive upsampling module and perform two upsampling operations consecutively. Each upsampling operation doubles the spatial resolution of the feature map and gradually restores shallow spatial details, so that the feature map size is restored from 64×64 to 256×256, and the fusion of shallow texture information and deep semantic information is completed.
[0085] Step 2.9: Input the recovered high-resolution features into the deformable spatial correction module, use convolution branches to predict the sampling offset and modulation weights corresponding to the deformable convolution, perform irregular position sampling on the feature map according to the sampling offset, and perform spatial compensation for the local non-rigid deformation caused by continuous tissue slicing and staining process to achieve local structural alignment between the phase map and the H&E staining map.
[0086] Step 2.10: Input the spatially corrected features into the PixelShuffle super-resolution reconstruction module. Complete the 2x super-resolution reconstruction by pixel rearrangement, and restore the 256×256 feature map to a 512×512 high-resolution feature map. This restores the tissue cell edge and fine-grained texture information while avoiding interpolation artifacts.
[0087] Step 2.11: Input the high-resolution features output by the PixelShuffle module into the output convolutional layer with a kernel size of 7×7 to complete feature mapping and color space restoration, and output a high-resolution virtual H&E staining image with a size of 3×512×512 through the Tanh activation function.
[0088] Step 3, Virtual staining super-resolution reconstruction: The low-resolution phase image patch obtained in Step 1 is input into the forward generator. Tissue morphology features are extracted through the shallow feature extraction unit and the downsampling encoding unit. Long-range dependencies between different tissue structures are established through the residual feature enhancement unit and the global relation enhancement spatial modeling unit. The offset and modulation weight of the pixel sampling position are predicted through the deformable spatial correction unit to compensate for the spatial position deviation and non-rigid deformation between the phase image and the H&E staining image. Finally, the sub-pixel super-resolution reconstruction unit performs 2x scale amplification to generate a high-resolution virtual H&E staining image. In step 3, a multi-criteria loss function is used to perform joint constraint training on the generator network. Adversarial learning, cycle consistency constraints, and super-resolution reconstruction supervision are used to jointly optimize the network parameters, achieving high-quality virtual stained images. First, an asymmetric generative adversarial training mechanism is constructed between the generator and the discriminator to drive the generator to learn the texture distribution features of real H&E stained images. Then, a cyclic mapping path is established from the phase map domain (domain A) to the H&E stained map domain (domain B) and back to the phase map domain (domain A), using cycle consistency loss to constrain the consistency of tissue structure during cross-modal transformation. Furthermore, a super-resolution reconstruction loss based on high-resolution real H&E stained images is introduced to provide pixel-level supervision of the generator output, improving the detail recovery capability of the virtual stained images. Finally, the Adam optimization algorithm is used to jointly optimize the various losses, and the trained generator model parameters are saved after model convergence. This model is then deployed as a virtual stained inference model to achieve end-to-end reconstruction from the original holographic image to a high-resolution H&E virtual stained image.
[0089] Example 6 The virtual staining super-resolution reconstruction method for unstained tissue pathological sections of the present invention is implemented according to the following steps: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and H&E stained full scan images corresponding to the unstained tissue pathological sections; sequentially perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of the unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previously aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method, resulting in a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central regions. The two-dimensional translation between the simulated holographic image and the current original holographic image is calculated using a Fourier phase correlation sub-pixel registration algorithm based on normalized cross-power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation, completing the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of each height original holographic image after alignment is normalized, and converted into the corresponding measurement amplitude based on the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measurement amplitude of the first acquisition plane and zero initial phase. A multi-height bidirectional cross-platform registration algorithm based on angular spectrum propagation is then used. The alternative projection phase recovery method involves propagating the complex optical field sequentially in the forward and backward directions between multiple acquisition planes. At each acquisition plane, the phase of the currently calculated complex optical field is retained, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Next, the phase distribution is unwrapped in two dimensions, and a Gaussian filter is used to obtain the low-frequency background phase. The unwrapped phase distribution is then subtracted from the low-frequency background phase, and after percentile truncation, linear normalization, and grayscale inversion, a standardized black-and-white phase map is obtained. Finally, the standardized black-and-white phase map is registered with the corresponding H&E-stained full scan image using an affine transformation. A sliding window sampling method with overlapping regions is used to simultaneously cut the registered standardized black-and-white phase map and the H&E-stained full scan image. Blank areas and invalid image blocks located at the registration edges are removed based on the grayscale mean and grayscale standard deviation of each image block, resulting in M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
[0090] Step 1 is implemented in the following steps: The workflow for constructing the sample is as follows: Step 1.1: Let the original holographic image sequence read be... ,in , representing the grayscale image captured at the nth height, with Using a reference coordinate system, sub-pixel alignment of the entire image sequence is achieved by calculating the spatial translation vector between adjacent frames and performing geometric transformations. Let the previously aligned image be... Based on the physical distance difference between adjacent shooting planes The image that has already been aligned in the previous frame. Projecting onto the current height plane yields a simulated hologram. , means as follows:
[0091] In the formula, Let be the transfer function for propagation in free space. and These represent the two-dimensional Fourier transform and the two-dimensional inverse Fourier transform, respectively. wavelength of the light source This represents the difference in axial distance between the previous acquisition plane and the current acquisition plane. These represent the spatial frequency coordinates in the horizontal and vertical directions, respectively. The current image to be aligned... The simulated reconstructed image corresponding to the current acquisition plane is obtained. Phase correlation calculations are performed to obtain the subpixel shift between the two images, and the cross-power spectrum is obtained. , means as follows:
[0092] By searching The peak position determines the subpixel translation vector. Using this vector pair Perform bilinear interpolation translation transformation to obtain the aligned image. ; Step 1.2: Read the holographic intensity image of the first acquisition plane after spatial alignment completed in Step 1.1. The initial light field is constructed using the intensity-amplitude relationship formula. :
[0093] This represents the normalized measured amplitude of the first acquisition plane. The image shows the holographic intensity image of the first acquisition plane.
[0094] The reconstructed complex optical field corresponding to each candidate propagation distance was calculated using the angular spectrum backpropagation algorithm:
[0095] Amplitude images corresponding to each reconstructed complex light field are extracted, the Sobel operator is used to calculate the gradient of the amplitude images, and the sharpness of the images corresponding to each candidate propagation distance is evaluated using the gradient Gini coefficient.
[0096] In the formula, Indicates the firsti The gradient Gini coefficients corresponding to the propagation distances of each candidate are... This represents the gradient magnitude of the corresponding reconstructed amplitude image. The candidate propagation distance with the largest gradient Gini coefficient is used as the initial recommended focal position. By interactively browsing through various candidate reconstructed images, the propagation distance corresponding to the clearest reconstructed image selected by the operator is ultimately determined as the focal position.
[0097] Step 1.3: Utilizing the intensity constraints of multiple acquisition planes, the complete complex amplitude information of the sample is recovered through an alternating projection iterative algorithm. The GS (Gerchberg-Saxton) algorithm is used to propagate the light field cyclically between N measurement planes. At each measurement plane n, the phase of the currently calculated light field is retained. The amplitude was obtained by converting the measured hologram. Replace constraints:
[0098] The updated light field will then be... The propagation continues to the next measurement surface n + 1. After iterative convergence, the complex optical field is propagated back to the object plane to extract the initial phase distribution. To address the phase wrapping problem, an unwrapping algorithm is used to recover continuous phase, and a Gaussian filter is used to construct a background model for background subtraction to eliminate system noise and low-frequency fringes.
[0099] In the formula, This represents the phase distribution after removing low-frequency background. This represents the continuous phase distribution after two-dimensional phase unwrapping. The standard deviation is A two-dimensional Gaussian filter kernel is used, and finally a standardized black-and-white phase map is generated by contrast stretching. Step 1.4: Select corresponding feature control points on the phase full image and H&E full scan image, and calculate the affine mapping matrix. ,use The H&E image is geometrically transformed and resampled to align the transformed H&E image with the initial spatial alignment of the phase map in the macroscopic coordinate system.
[0100] In the formula, ( ) represents the coordinates of the control points in the H&E staining full scan image; ) represents the corresponding coordinates after affine mapping; This represents the affine transformation matrix calculated from the corresponding feature control points.
[0101] A sliding window with a fixed step size is used to simultaneously cut the registered dual-domain large image, and a fixed proportion of overlapping area is set to increase sample diversity and reduce boundary information loss. Calculate image statistics for the segmented image patches and classify them using a threshold discrimination method:
[0102] Invalid "waste blocks" containing blank areas, overexposure, or registration edge artifacts are removed, ultimately generating a set of valid paired blocks. .
[0103] In the formula, This represents the average grayscale value of the current image patch; This represents the standard deviation of the grayscale values of the current image patch; and These represent the lower and upper limits of the average grayscale threshold, respectively; Indicates the image texture discrimination threshold; Indicates the first One effective phase image block; Indicates the first H&E staining image blocks corresponding to each effective phase image block.
[0104] The single-channel effective phase image block is copied three times along the channel dimension to construct a three-channel phase image block, which is then used as input to the subsequent virtual staining super-resolution reconstruction network.
[0105] Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. In step 2, a generative network model based on global relation enhancement and spatial alignment is constructed to achieve deep feature fusion and mapping from holographic phase features to pathological staining morphology. First, the input phase block is downsampled and encoded through cascaded strided convolutional layers to extract deep semantic features containing tissue morphology information. Then, a multi-head self-attention operation within a local window is performed using a global relation enhancement spatial modeling module to enhance the model's global understanding of complex pathological backgrounds by establishing long-range dependencies between tissue structures. Next, a deformable spatial correction unit is introduced to predict pixel-level dynamic offset fields and weight masks in parallel, and a sampling point compensation mechanism is used to eliminate non-rigid deformation between the phase map and the staining map, ensuring accurate alignment of the feature space at the physical scale. Finally, channel recombination and scale augmentation are performed through sub-pixel convolutional layers at the end to map the features to the high-magnification staining image domain, ultimately outputting a high-fidelity virtual staining preliminary result.
[0106] Step 2 is implemented in the following steps: Step 2.1: Extract the effective phase image block obtained in Step 1. An input reflection fill layer is used to fill the image boundaries with a width of 3 to eliminate convolution edge effects; then, using... The convolutional kernel performs feature mapping with a stride of 1 and performs non-linear mapping through the ReLU activation function, mapping the input space to a shallow feature space with 64 channels; Step 2.2: Perform two consecutive downsampling operations on the shallow features. Each operation includes a convolutional kernel with a size of [missing value]. A strided convolutional layer with a stride of 2 is followed by instance normalization and the LeakyReLU activation function; through this step, the feature map scale is reduced from... Down to Meanwhile, the number of channels was expanded from 64 to 256, enabling preliminary compression modeling of the global semantics of the image; Step 2.3: Input the downsampled features into the feature enhancement sequence consisting of 6 residual blocks. Each residual block contains two... A convolutional layer and a skip connection path are used to define the input features as follows: Output features , means as follows:
[0107] In the formula, ( () indicates a convolution operation with a kernel size of 3×3; ( ) indicates instance normalization operation; ( ) represents the linear rectification activation function; Represents input features; This step represents the output features. It extracts deep texture features from pathological tissues using a residual learning mechanism. Step 2.4: The feature input channel adaptation module after residual enhancement uses a convolutional layer with a kernel size of 1×1 to linearly map the features, compressing the number of feature channels from 256 to 128. This reduces the computational complexity of subsequent window self-attention while preserving semantic information as much as possible, providing a unified input dimension for the global relation enhancement module.
[0108] Step 2.5: First, perform LayerNorm normalization on the channel-adapted features to stabilize the feature distribution; then, divide the features into multiple non-overlapping local windows according to a fixed window size to establish input units for subsequent windowed multi-head self-attention calculation.
[0109] Step 2.6: Perform windowed multi-head self-attention operation within each local window, and perform linear mapping on the input features to obtain the query matrix. Key matrix K Sum matrix V The attention weights between pixels within the window are calculated using the query matrix, key matrix, and value matrix. The calculation process is as follows:
[0110] In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Represents the learnable relative position bias matrix; Indicates matrix transpose; This represents the normalization function. By establishing long-range dependencies between different tissue structures through windowed self-attention, the global expressive power of complex pathological tissue morphology is improved.
[0111] Step 2.7: Input the windowed self-attention output features into the residual refinement module. The residual refinement module includes a LayerNorm normalization layer, a convolutional layer with a kernel size of 3×3, and residual connection paths. It further fuses the features after global relation enhancement and restores local details, thereby improving the ability to express tissue edges and texture details.
[0112] Step 2.8: Input the refined residual features into the progressive upsampling module and perform two upsampling operations consecutively. Each upsampling operation doubles the spatial resolution of the feature map and gradually restores shallow spatial details, so that the feature map size is restored from 64×64 to 256×256, and the fusion of shallow texture information and deep semantic information is completed.
[0113] Step 2.9: Input the recovered high-resolution features into the deformable spatial correction module, use convolution branches to predict the sampling offset and modulation weights corresponding to the deformable convolution, perform irregular position sampling on the feature map according to the sampling offset, and perform spatial compensation for the local non-rigid deformation caused by continuous tissue slicing and staining process to achieve local structural alignment between the phase map and the H&E staining map.
[0114] Step 2.10: Input the spatially corrected features into the PixelShuffle super-resolution reconstruction module. Complete the 2x super-resolution reconstruction by pixel rearrangement, and restore the 256×256 feature map to a 512×512 high-resolution feature map. This restores the tissue cell edge and fine-grained texture information while avoiding interpolation artifacts.
[0115] Step 2.11: Input the high-resolution features output by the PixelShuffle module into the output convolutional layer with a kernel size of 7×7 to complete feature mapping and color space restoration, and output a high-resolution virtual H&E staining image with a size of 3×512×512 through the Tanh activation function.
[0116] Step 3, Virtual staining super-resolution reconstruction: The low-resolution phase image patch obtained in Step 1 is input into the forward generator. Tissue morphology features are extracted through the shallow feature extraction unit and the downsampling encoding unit. Long-range dependencies between different tissue structures are established through the residual feature enhancement unit and the global relation enhancement spatial modeling unit. The offset and modulation weight of the pixel sampling position are predicted through the deformable spatial correction unit to compensate for the spatial position deviation and non-rigid deformation between the phase image and the H&E staining image. Finally, the sub-pixel super-resolution reconstruction unit performs 2x scale amplification to generate a high-resolution virtual H&E staining image. In step 3, a multi-criteria loss function is used to perform joint constraint training on the generator network. Adversarial learning, cycle consistency constraints, and super-resolution reconstruction supervision are used to jointly optimize the network parameters, achieving high-quality virtual stained images. First, an asymmetric generative adversarial training mechanism is constructed between the generator and the discriminator to drive the generator to learn the texture distribution features of real H&E stained images. Then, a cyclic mapping path is established from the phase map domain (domain A) to the H&E stained map domain (domain B) and back to the phase map domain (domain A), using cycle consistency loss to constrain the consistency of tissue structure during cross-modal transformation. Furthermore, a super-resolution reconstruction loss based on high-resolution real H&E stained images is introduced to provide pixel-level supervision of the generator output, improving the detail recovery capability of the virtual stained images. Finally, the Adam optimization algorithm is used to jointly optimize the various losses, and the trained generator model parameters are saved after model convergence. This model is then deployed as a virtual stained inference model to achieve end-to-end reconstruction from the original holographic image to a high-resolution H&E virtual stained image.
[0117] Step 3 is implemented in the following steps: Step 3.1: The virtual staining super-resolution generator constructed in Step 2 is trained adversarially using a CycleGAN bidirectional generative adversarial network. The generator... Used to implement the mapping from the phase map domain (domain A) to the H&E staining map domain (domain B); generator Used to achieve the inverse mapping from the H&E staining map domain (B domain) to the phase map domain (A domain); discriminator Used to determine the authenticity between generated virtual H&E staining images and real H&E staining images; discriminator Used to determine the consistency between the reconstructed phase map and the true phase map. The virtual staining image generated in step 2... Compared with real H&E staining images Input discriminator The discriminator extracts spatial distribution features through consecutive convolutional layers and outputs a true / false probability map; the generator is computed. The adversarial loss guides the generator to learn the texture distribution features of the stained domain:
[0118] In the formula, For the input phase image patch, For real H&E staining image patches; This represents a virtual H&E staining image generated by the generator; ( ) represents the probability of the discriminator output being true.
[0119] Step 3.2: Establish a cyclic mapping path from the phase map domain (domain A) to the H&E staining map domain (domain B) and back to the phase map domain (domain A), and generate a high-resolution virtual H&E staining image. Input reverse generator The inverse generator first performs a 2x downsampling to restore the image to its phase. Figure 1 To achieve the desired spatial resolution, reverse feature extraction and image reconstruction are then performed, outputting a reconstructed phase map. Reconstructing the phase map through calculation With the original input The pixel-level absolute error between them constrains the consistency of the organizational structure during the cyclic mapping process:
[0120] Step 3.3: For the high-resolution virtual H&E staining image output in Step 2.11, use the high-resolution real H&E staining image constructed in Step 1. As a supervisory label, the spatial consistency loss between the generated image and the real high-resolution image is calculated, providing accurate pixel-level guidance for the sub-pixel convolutional layers at the end of the network:
[0121] Step 3.4: Construct the overall objective function for pathological diagnosis tasks. The adversarial, cyclic, and super-resolution losses mentioned above are then weighted and integrated:
[0122] in , , , The weight coefficients of each constraint term are used to calculate the gradient of the total loss with respect to the parameters of each layer in the network, including the attention coefficient of the global relation enhancement module and the offset field parameters of the spatial correction layer, providing a numerical basis for parameter updates. Step 3.5: Use the Adam optimizer to perform end-to-end training. In each iteration, use the backpropagation algorithm to transmit gradient information from the end loss layer to the front coding layer. By continuously correcting the network parameters, make the virtual staining results statistically close to the real pathological slides. Step 3.6: When the training process meets the preset convergence criterion, solidify the generator. The model parameters will be used to generate the generator after training. Parameters are fixed and will Deployed as a virtual staining inference model, this model can directly receive the real-time phase feature blocks processed in step 1 and automatically generate high-resolution H&E virtual staining images that conform to clinical diagnostic habits, thereby completing the end-to-end conversion task from the original hologram to the digital pathological image.
[0123] Step 4, Network Training and Parameter Optimization: A generative adversarial training path is constructed using the phase image domain discriminator and the H&E staining image domain discriminator. A cyclic consistency transformation path is constructed using the forward generator and the inverse generator. An end-to-end training of the virtual staining super-resolution reconstruction network is performed using a joint loss function composed of adversarial loss, cyclic consistency loss, and super-resolution pixel consistency loss. After training, the network parameters of the forward generator are fixed. Step 5: Virtual staining image generation: Input the phase image of the unstained tissue pathology section to be processed into the trained forward generator, and output the corresponding high-resolution virtual H&E staining image, as shown in Figure 4(a) and Figure 4(b).
[0124] The effects of existing methods and the method of the present invention are compared, as shown in Table 1: Table 1 Model Indicator Table
[0125] By comparing the various methods shown in Table 1, it can be seen that the method of the present invention achieves the best final result.
Claims
1. A method for virtual staining super-resolution reconstruction of unstained tissue pathological sections, characterized in that, Includes the following steps: Step 1, Preprocessing: Acquire the holographic sequence of the slice and the corresponding H&E staining image, obtain the phase map through phase operation, register the slice blocks to remove bad images, and build a high- and low-resolution paired training set; Step 2: Construct a reconstruction network containing two generators and two discriminators; Step 3: The low-resolution phase map is fed into the forward generator, and after multi-module feature processing, deformation compensation and sub-pixel magnification, a high-definition virtual color map is generated. Step 4: Train the network using adversarial, recurrent, and pixel-based multi-loss methods to lock the parameters of the forward generator; Step 5: Input the phase map to be tested into the trained network and output a high-resolution virtual H&E staining map.
2. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 1, characterized in that, The specific steps are as follows: Step 1: Data Preprocessing: Acquire multi-height raw holographic image sequences of unstained tissue pathological sections and corresponding H&E stained full scan images; perform image alignment, interactive focal plane calibration, multi-height iterative phase recovery, phase unwrapping, and background correction on the multi-height raw holographic image sequences to obtain phase maps of unstained tissue pathological sections; perform image registration, synchronous cutting, and invalid image block removal on the phase maps and H&E stained full scan images to construct a training sample set consisting of low-resolution phase image blocks and high-resolution H&E stained image blocks; Step 2: Construct a Virtual H&E Coloring Super-Resolution Reconstruction Network: The Virtual H&E Coloring Super-Resolution Reconstruction Network includes a forward generator, an inverse generator, a phase image domain discriminator, and a H&E coloring image domain discriminator. The forward generator consists of a shallow feature extraction unit, a downsampling encoding unit, a residual feature enhancement unit, a global relation enhancement spatial modeling unit, an upsampling decoding unit, a deformable spatial correction unit, and a sub-pixel super-resolution reconstruction unit, connected in sequence, used to convert low-resolution phase image patches into high-resolution virtual H&E coloring images. The inverse generator is used to convert virtual H&E coloring images into reconstructed phase images. The phase image domain discriminator is used to distinguish between the original phase image and the reconstructed phase image, and the H&E coloring image domain discriminator is used to distinguish between real H&E coloring images and virtual H&E coloring images. Step 3, Virtual staining super-resolution reconstruction: The low-resolution phase image patch obtained in Step 1 is input into the forward generator. Tissue morphology features are extracted through the shallow feature extraction unit and the downsampling encoding unit. Long-range dependencies between different tissue structures are established through the residual feature enhancement unit and the global relation enhancement spatial modeling unit. The offset and modulation weight of the pixel sampling position are predicted through the deformable spatial correction unit to compensate for the spatial position deviation and non-rigid deformation between the phase image and the H&E staining image. Finally, the sub-pixel super-resolution reconstruction unit performs 2x scale amplification to generate a high-resolution virtual H&E staining image. Step 4, Network Training and Parameter Optimization: Construct a generative adversarial training path using the phase image domain discriminator and the H&E staining image domain discriminator, construct a cycle consistency transformation path using the forward generator and the inverse generator, and perform end-to-end training on the virtual staining super-resolution reconstruction network using a joint loss function composed of adversarial loss, cycle consistency loss, and super-resolution pixel consistency loss. After training is completed, the network parameters of the forward generator are fixed. Step 5: Virtual staining image generation: Input the phase image of the unstained tissue pathology section to be processed into the trained forward generator, and output the corresponding high-resolution virtual H&E staining image.
3. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 2, characterized in that, In step 1, the acquired multi-height original holographic image sequence is processed into a standardized cross-modal paired image block set. First, using the first original holographic image as a reference, based on the axial distance between adjacent acquisition planes, the complex optical field corresponding to the previous aligned original holographic image is propagated to the current acquisition plane using the angular spectrum propagation method to obtain a simulated holographic image at the same acquisition height as the current original holographic image. The central regions of the simulated holographic image and the current original holographic image are respectively extracted, and a Hanning window is applied to the central region. The two-dimensional translation amount between the simulated holographic image and the current original holographic image is calculated using the Fourier phase correlation sub-pixel registration algorithm based on the normalized cross power spectrum. The current original holographic image is then translated and corrected based on the two-dimensional translation amount to complete the sub-pixel level alignment of the multi-height original holographic image sequence. Subsequently, the intensity of the aligned original holographic images at each height is normalized, and the corresponding measured amplitude is converted according to the square relationship between light intensity and amplitude. An initial complex optical field is constructed using the measured amplitude of the first acquisition plane and the zero initial phase. A multi-height bidirectional alternating projection phase recovery method based on angular spectrum propagation is adopted, so that the complex optical field propagates forward and backward sequentially between multiple acquisition planes. The phase of the currently calculated complex optical field is retained in each acquisition plane, and the amplitude of the currently calculated complex optical field is replaced by the measured amplitude of the corresponding acquisition plane. After a preset number of bidirectional alternating projection iterations, the recovered complex optical field is propagated backward to the object plane to extract the phase distribution of the object plane. Then, the phase distribution is unwrapped in two dimensions, and the low-frequency background phase is obtained by Gaussian filtering. The unwrapped phase distribution is then subtracted from the low-frequency background phase. After percentile truncation, linear normalization and grayscale inversion, a standardized black and white phase image is obtained. Finally, the standardized black-and-white phase image is registered with the corresponding H&E staining full scan image through affine transformation. The registered standardized black-and-white phase image and H&E staining full scan image are simultaneously cut using a sliding window sampling method with overlapping regions. Blanks and invalid image blocks located at the registration edge are removed according to the gray mean and gray standard deviation of each image block to obtain M sets of cross-modal paired image blocks for training the virtual staining super-resolution reconstruction network.
4. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 3, characterized in that, Step 1 is implemented in the following steps: The workflow for constructing the sample is as follows: Step 1.1: Let the original holographic image sequence read be... ,in , representing the grayscale image captured at the nth height, with Using a reference coordinate system, sub-pixel alignment of the entire image sequence is achieved by calculating the spatial translation vector between adjacent frames and performing geometric transformations. Let the previously aligned image be... Based on the physical distance difference between adjacent shooting planes The image that has already been aligned in the previous frame. Projecting onto the current height plane yields a simulated hologram. , means as follows: In the formula, Let be the transfer function for propagation in free space. and These represent the two-dimensional Fourier transform and the two-dimensional inverse Fourier transform, respectively. wavelength of the light source This represents the difference in axial distance between the previous acquisition plane and the current acquisition plane. Representing the spatial frequency coordinates in the horizontal and vertical directions respectively, the current image to be aligned is... The simulated reconstructed image corresponding to the current acquisition plane is obtained. Phase correlation calculations are performed to obtain the subpixel shift between the two images, and the cross-power spectrum is obtained. , means as follows: By searching The peak position determines the subpixel translation vector. Using this vector pair Perform bilinear interpolation translation transformation to obtain the aligned image. ; Step 1.2: Read the holographic intensity image of the first acquisition plane after spatial alignment completed in Step 1.
1. The initial light field is constructed using the intensity-amplitude relationship formula. : This represents the normalized measured amplitude of the first acquisition plane. Show the holographic intensity image of the first acquisition plane; The reconstructed complex optical field corresponding to each candidate propagation distance was calculated using the angular spectrum backpropagation algorithm: Amplitude images corresponding to each reconstructed complex light field are extracted, the Sobel operator is used to calculate the gradient of the amplitude images, and the sharpness of the images corresponding to each candidate propagation distance is evaluated using the gradient Gini coefficient. In the formula, Indicates the first i The gradient Gini coefficients corresponding to the propagation distances of each candidate are... This represents the gradient magnitude of the corresponding reconstructed amplitude image. The candidate propagation distance with the largest gradient Gini coefficient is used as the initial recommended focal position. By interactively browsing through various candidate reconstructed images, the propagation distance corresponding to the clearest reconstructed image selected by the operator is finally determined as the focal position. ; Step 1.3: Utilizing the intensity constraints of multiple acquisition planes, the complete complex amplitude information of the sample is recovered through an alternating projection iterative algorithm. The GS algorithm is used to propagate the light field cyclically between N measurement planes, and the phase of the currently calculated light field is retained at each measurement plane n. The amplitude was obtained by converting the measured hologram. Replace constraints: The updated light field will then be... The propagation continues to the next measurement surface n + 1. After iterative convergence, the complex optical field is propagated back to the object plane to extract the initial phase distribution. To address the phase wrapping problem, an unwrapping algorithm is used to recover continuous phase, and a Gaussian filter is used to construct a background model for background subtraction to eliminate system noise and low-frequency fringes. In the formula, This represents the phase distribution after removing low-frequency background. This represents the continuous phase distribution after two-dimensional phase unwrapping. The standard deviation is A two-dimensional Gaussian filter kernel is used, and finally a standardized black-and-white phase map is generated by contrast stretching. Step 1.4: Select corresponding feature control points on the phase full image and H&E full scan image, and calculate the affine mapping matrix. ,use The H&E image is geometrically transformed and resampled to align the transformed H&E image with the initial spatial alignment of the phase map in the macroscopic coordinate system. In the formula, ( ) represents the coordinates of the control points in the H&E staining full scan image; ) represents the corresponding coordinates after affine mapping; This represents the affine transformation matrix calculated from the corresponding feature control points; A sliding window with a fixed step size is used to simultaneously cut the registered dual-domain large image, and a fixed proportion of overlapping area is set to increase sample diversity and reduce boundary information loss. Calculate image statistics for the segmented image patches and classify them using a threshold discrimination method: Invalid "waste blocks" containing blank areas, overexposure, or registration edge artifacts are removed, ultimately generating a set of valid paired blocks. ; In the formula, This represents the average grayscale value of the current image patch; This represents the standard deviation of the grayscale values of the current image patch; and These represent the lower and upper limits of the average grayscale threshold, respectively; Indicates the image texture discrimination threshold; Indicates the first One effective phase image block; Indicates the first H&E staining image blocks corresponding to each effective phase image block; The single-channel effective phase image block is copied three times along the channel dimension to construct a three-channel phase image block, which is then used as input to the subsequent virtual staining super-resolution reconstruction network.
5. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 4, characterized in that, In step 2, a generative network model based on global relation enhancement and spatial alignment is constructed to achieve deep feature fusion and mapping from holographic phase features to pathological staining morphology. First, the input phase block is downsampled and encoded through cascaded strided convolutional layers to extract deep semantic features containing tissue morphology information. Then, the global relation enhancement spatial modeling module is used to perform multi-head self-attention operations within a local window. By establishing long-range dependencies between tissue structures, the model's global understanding of complex pathological backgrounds is enhanced. Next, a deformable spatial correction unit is introduced to predict pixel-level dynamic offset fields and weight masks in parallel. The sampling point compensation mechanism is used to eliminate non-rigid deformation between the phase map and the staining map, ensuring accurate alignment of the feature space at the physical scale. Finally, channel recombination and scale expansion are performed through sub-pixel convolutional layers at the end to map the features to the high-magnification staining image domain, ultimately outputting a high-fidelity virtual staining preliminary result.
6. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 5, characterized in that, Step 2 is implemented in the following steps: Step 2.1: Extract the effective phase image block obtained in Step 1. An input reflection fill layer is used to fill the image boundaries with a width of 3 to eliminate convolution edge effects; then, using... The convolutional kernel performs feature mapping with a stride of 1 and performs non-linear mapping through the ReLU activation function, mapping the input space to a shallow feature space with 64 channels; Step 2.2: Perform two consecutive downsampling operations on the shallow features. Each operation includes a convolutional kernel with a size of [missing value]. A strided convolutional layer with a stride of 2, followed by instance normalization and the LeakyReLU activation function; Through this step, the feature map scale is changed from... Down to Meanwhile, the number of channels was expanded from 64 to 256, enabling preliminary compression modeling of the global semantics of the image; Step 2.3: Input the downsampled features into the feature enhancement sequence consisting of 6 residual blocks. Each residual block contains two... A convolutional layer and a skip connection path are used to define the input features as follows: Output features , means as follows: In the formula, ( () indicates a convolution operation with a kernel size of 3×3; ( ) indicates instance normalization operation; ( ) represents the linear rectification activation function; Represents input features; This step represents the output features, and it extracts deep texture features of pathological tissues through a residual learning mechanism. Step 2.4: The feature input channel adaptation module after residual enhancement uses a convolutional layer with a kernel size of 1×1 to linearly map the features, compressing the number of feature channels from 256 to 128. This reduces the computational complexity of subsequent window self-attention while preserving the semantic information as much as possible, and provides a unified input dimension for the global relation enhancement module. Step 2.5: First, perform LayerNorm normalization on the channel-adapted features to stabilize the feature distribution; then, divide the features into multiple non-overlapping local windows according to a fixed window size to establish input units for subsequent windowed multi-head self-attention calculation. Step 2.6: Perform windowed multi-head self-attention operation within each local window, and perform linear mapping on the input features to obtain the query matrix. Key matrix K Sum matrix V The attention weights between pixels within the window are calculated using the query matrix, key matrix, and value matrix. The calculation process is as follows: In the formula, Represents the query matrix; Represents the key matrix; Represents a value matrix; Indicates the dimension of the key vector; Represents the learnable relative position bias matrix; Indicates matrix transpose; This represents a normalization function, which establishes long-range dependencies between different tissue structures through windowed self-attention, thereby improving the global expressive power of complex pathological tissue morphology. Step 2.7: Input the windowed self-attention output features into the residual refinement module. The residual refinement module includes a LayerNorm normalization layer, a 3×3 convolutional layer, and residual connection paths to further fuse the features after global relation enhancement and restore local details, thereby improving the ability to express tissue edges and texture details. Step 2.8: Input the refined residual features into the progressive upsampling module and perform two upsampling operations consecutively. Each upsampling operation will increase the spatial resolution of the feature map by 2 times and gradually restore the shallow spatial details, so that the feature map size is restored from 64×64 to 256×256, and the fusion of shallow texture information and deep semantic information is completed. Step 2.9: Input the recovered high-resolution features into the deformable spatial correction module, use the convolution branch to predict the sampling offset and modulation weights corresponding to the deformable convolution, perform irregular position sampling on the feature map according to the sampling offset, and perform spatial compensation for the local non-rigid deformation caused by continuous tissue slicing and staining process to achieve local structural alignment between the phase map and the H&E staining map. Step 2.10: Input the spatially corrected features into the PixelShuffle super-resolution reconstruction module. Complete the 2x super-resolution reconstruction by pixel rearrangement, and restore the 256×256 feature map to a 512×512 high-resolution feature map. While avoiding interpolation artifacts, restore the tissue cell edge and fine-grained texture information. Step 2.11: Input the high-resolution features output by the PixelShuffle module into the output convolutional layer with a kernel size of 7×7 to complete feature mapping and color space restoration, and output a high-resolution virtual H&E staining image with a size of 3×512×512 through the Tanh activation function.
7. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 6, characterized in that, In step 3, a multi-criteria loss function is used to perform joint constraint training on the generator network. Adversarial learning, cycle consistency constraints, and super-resolution reconstruction supervision are used to jointly optimize network parameters, achieving high-quality virtual stained images. First, an asymmetric generative adversarial training mechanism is constructed between the generator and the discriminator to drive the generator to learn the texture distribution features of real H&E stained images. Then, a cyclic mapping path is established from the phase domain to the H&E stained domain and back to the phase domain, using cycle consistency loss to constrain the consistency of tissue structure during cross-modal transformation. Furthermore, a super-resolution reconstruction loss based on high-resolution real H&E stained images is introduced to perform pixel-level supervision of the generator output, improving the detail recovery capability of the virtual stained images. Finally, the Adam optimization algorithm is used to jointly optimize the various losses, and the trained generator model parameters are saved after model convergence and deployed as a virtual stained inference model to achieve end-to-end reconstruction from the original holographic image to a high-resolution H&E virtual stained image.
8. The virtual staining super-resolution reconstruction method for unstained tissue pathological sections according to claim 7, characterized in that, Step 3 is implemented in the following steps: Step 3.1: The virtual coloring super-resolution generator constructed in Step 2 is trained adversarially using a CycleGAN bidirectional generative adversarial network. The generator... Used to map the phase map domain to the H&E staining map domain; generator Used to achieve the inverse mapping from the H&E staining domain to the phase domain; discriminator Used to determine the authenticity between generated virtual H&E staining images and real H&E staining images; discriminator The virtual staining image generated in step 2 is used to determine the consistency between the reconstructed phase map and the true phase map. Compared with real H&E staining images Input discriminator The discriminator extracts spatial distribution features through consecutive convolutional layers and outputs a true / false probability map; the generator is computed. The adversarial loss guides the generator to learn the texture distribution features of the stained domain: In the formula, For the input phase image patch, For real H&E staining image patches; This represents a virtual H&E staining image generated by the generator; ( ) represents the probability of the discriminator output being true; Step 3.2: Establish a cyclic mapping path from phase domain to H&E staining domain to phase domain, and generate a high-resolution virtual H&E staining image. Input reverse generator The inverse generator first performs a 2x downsampling to restore the image to a spatial resolution consistent with the phase map, then performs inverse feature extraction and image reconstruction, outputting a reconstructed phase map. Reconstructing the phase map through calculation With the original input The pixel-level absolute error between them constrains the consistency of the organizational structure during the cyclic mapping process: Step 3.3: For the high-resolution virtual H&E staining image output in Step 2.11, use the high-resolution real H&E staining image constructed in Step 1. As a supervisory label, the spatial consistency loss between the generated image and the real high-resolution image is calculated, providing accurate pixel-level guidance for the sub-pixel convolutional layers at the end of the network: Step 3.4: Construct the overall objective function for pathological diagnosis tasks. The adversarial, cyclic, and super-resolution losses mentioned above are then weighted and integrated: in , , , The weight coefficients of each constraint term are used to calculate the gradient of the total loss with respect to the parameters of each layer in the network, including the attention coefficient of the global relation enhancement module and the offset field parameters of the spatial correction layer, providing a numerical basis for parameter updates. Step 3.5: Use the Adam optimizer to perform end-to-end training. In each iteration, use the backpropagation algorithm to transmit gradient information from the end loss layer to the front coding layer. By continuously correcting the network parameters, make the virtual staining results statistically close to the real pathological slides. Step 3.6: When the training process meets the preset convergence criterion, solidify the generator. The model parameters will be used to generate the generator after training. Parameters are fixed and will Deployed as a virtual staining inference model, this model can directly receive the real-time phase feature blocks processed in step 1 and automatically generate high-resolution H&E virtual staining images that conform to clinical diagnostic habits, thereby completing the end-to-end conversion task from the original hologram to the digital pathological image.
