Pathological section color complementing method based on artificial intelligence
By employing an AI-based dual-branch parallel architecture design and a multi-dimensional optimization training strategy, the problem of pathological slide fading was solved, achieving high-precision, adaptive staining recovery and ensuring the diagnostic reliability and applicability of pathological slides.
Patent Information
- Application Number
- CN202511331898.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2025-12-12
AI Technical Summary
Existing technologies are unable to effectively separate tissue structures and staining features, and lack the ability to adaptively adjust the degree of fading, resulting in artifacts or structural distortions in the images generated from pathological sections, making it difficult to meet the reliability requirements of clinical diagnosis.
We adopt an AI-based dual-branch parallel architecture design. The structure branch generator maintains the integrity of the tissue morphology, and the staining branch generator realizes adaptive staining feature recovery. We combine a multi-dimensional joint optimization training strategy and an unsupervised learning mode to construct a complementary color model.
It achieves high-precision color matching of pathological sections, ensuring accurate preservation of cell and tissue structures, intelligently adjusts to different degrees of fading, outputs results that meet professional-grade quality standards, reduces the difficulty of data collection, and is adaptable to pathological section data from different sources.
Smart Images

Figure CN121120804A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of digital pathology technology, and in particular to an artificial intelligence-based method for color correction of pathological slides. Background Technology
[0002] In the field of digital pathology, the staining quality of pathological slides directly affects the accuracy of diagnostic results. However, due to factors such as stain degradation, light aging, or poor storage conditions, long-term stored pathological slides often exhibit fading, leading to blurred tissue structures and staining features. Traditional staining correction methods are mainly based on color space transformation and statistical matching techniques. Although computationally efficient, they are difficult to adapt to complex and varied fading conditions and are prone to damaging the fine structure of tissues. In recent years, deep learning-based virtual staining technology has made significant progress, especially generative adversarial networks, which have shown advantages in staining style transfer. However, these methods still have significant shortcomings: on the one hand, most models fail to effectively separate tissue structure and staining features, resulting in artifacts or structural distortions in the generated images; on the other hand, existing methods lack the ability to adaptively adjust to the degree of fading, and the model decision-making process lacks interpretability, making it difficult to meet the stringent reliability requirements of clinical diagnosis. Summary of the Invention
[0003] In view of the above-mentioned shortcomings in the prior art, the present invention provides an artificial intelligence-based method for color correction of pathological sections, which solves the problem of low staining quality of pathological sections in the prior art.
[0004] To achieve the above-mentioned objectives, the technical solution adopted by this invention is: a pathological slide color correction method based on artificial intelligence, comprising: S1: Digitize the faded and normal stained images of the same type of staining in the pathological sections to obtain the training dataset; S2: Standardize the faded slice images in the training dataset to obtain the target faded slice image; S3: Construct a complementary color model; S4: Use the training dataset to train the complementary color model and obtain the trained complementary color model; S5: Use the trained complementary color model to process the target faded slice image to obtain complementary color image blocks; S6: Stitch together the complementary color image blocks of the same slice to obtain the complementary color result, thus completing the complementary color of the pathological slice.
[0005] The beneficial effects of the present invention are as follows: The present invention provides a pathological slide color restoration method based on artificial intelligence. It adopts a dual-branch parallel architecture design. The structural branch generator focuses on maintaining the integrity of tissue morphology, while the staining branch generator realizes adaptive staining feature restoration, which effectively solves the structural distortion problem commonly found in traditional methods. This unique architecture design not only ensures the accurate preservation of cell and tissue structure, but also makes intelligent adjustments for different degrees of fading, making the color restoration effect more natural and reliable. (1) In terms of staining restoration technology, this method realizes intelligent processing of pathological slide fading by introducing an advanced degradation perception mechanism. This mechanism can automatically adjust the color restoration intensity according to the actual degree of fading of the slide, which can effectively repair severely fading areas and maintain the original features of slightly fading areas. At the same time, scientific numerical constraints ensure that the output results meet the standard requirements of pathological diagnosis, which greatly improves the accuracy and applicability of staining restoration. (2) A multi-dimensional joint optimization training strategy is adopted. By comprehensively considering multiple key indicators such as tissue structure preservation, staining consistency, and image authenticity, comprehensive optimization is achieved during model training. This comprehensive optimization scheme not only ensures the structural accuracy of the generated images, but also ensures the coordination and naturalness of the staining effect, so that the final output results reach the professional-level quality standard. (3) A multi-dimensional joint optimization training strategy is adopted. By comprehensively considering multiple key indicators such as tissue structure preservation, staining consistency, and image authenticity, comprehensive optimization is achieved during the model training process. This comprehensive optimization scheme not only ensures the structural accuracy of the generated images, but also ensures the coordination and naturalness of the staining effect, so that the final output results reach the professional-level quality standard. (4) The unsupervised learning mode adopted greatly reduces the difficulty of data collection and can adapt to pathological slide data of different sources and different qualities. This flexible data requirement makes the technology easier to promote and apply in the actual medical environment, while maintaining a high-efficiency processing speed and demonstrating excellent engineering implementation value. Overall, this method shows obvious advantages in terms of technological advancement, clinical applicability, and engineering feasibility.
[0006] Furthermore, the complementary color model includes: The generator network is used to extract features, restore color features, and fuse features from images in the training dataset to obtain generated images. A discriminator network is used to distinguish the staining style and pathological information of the generated image to obtain the results of the slide authenticity judgment.
[0007] Furthermore, the generator network includes: The structural branch generator is used to extract cellular and tissue structural features from the training dataset by employing multi-scale convolution and residual block groups to obtain structural features. A coloring branch generator is used to adaptively recover coloring features from the training dataset by using residual block groups, fusion fading degree parameters and target coloring labels, to obtain coloring features; A feature fusion subnetwork is used to fuse structural and staining features to obtain a generated image. The structural branch generator and the staining branch generator are parallel structures. The structural branch generator extracts the tissue morphology and spatial structure information from the input tissue slice image, while the staining branch generator extracts the color distribution and texture features of the target staining style. By fusing the structural features output by the structural branch generator and the staining features output by the staining branch generator, staining style transfer is achieved on the original image while preserving the tissue structure, resulting in a generated image.
[0008] Furthermore, the structural branch generator comprises: an input image layer, a first convolutional layer, a first instance normalization layer, a first activation layer, a first downsampled reflection fill layer, a second convolutional layer, a second instance normalization layer, a second activation layer, a second downsampled reflection fill layer, a third convolutional layer, a third instance normalization layer, a third activation layer, and a residual block group connected in sequence; wherein, the residual block group consists of multiple standard residual blocks, each standard residual block includes two sub-blocks, and each sub-block is connected in sequence to the reflection fill layer, the convolutional layer, the instance normalization layer, and the activation layer within the residual block, ultimately outputting structural features.
[0009] Furthermore, the coloring branch generator includes: a coloring input layer, a first coloring convolutional layer, a first coloring degradation-aware normalization layer, a first coloring activation layer, a first coloring downsampled reflection-filling layer, a second coloring convolutional layer, a second coloring degradation-aware normalization layer, a second coloring activation layer, a second coloring downsampled reflection-filling layer, a third coloring convolutional layer, a third coloring degradation-aware normalization layer, a third coloring activation layer, and a degradation-aware residual block group; wherein the degradation-aware residual block group consists of multiple degradation-aware residual blocks, each degradation-aware residual block includes two sub-blocks, each sub-block sequentially including a reflection-filling layer within the residual block, a convolutional layer within the residual block, a degradation-aware normalization layer within the residual block, and an activation layer within the residual block. The degradation-aware normalization layer achieves adaptive complementary color adjustment by fusing the fading degree parameter and the target coloring label through a dynamic style coding mechanism, performs adaptive coloring feature recovery on the training dataset, and finally outputs the coloring features.
[0010] Furthermore, the feature fusion sub-network includes: a feature input layer, a splicing layer, a first feature convolutional layer, a gated generation layer, a gated fusion computation unit, a second feature convolutional layer, a first feature activation layer, a first feature upsampling layer, a third feature convolutional layer, a first feature normalization layer, a second feature activation layer, a second feature upsampling layer, a fourth feature convolutional layer, a second feature normalization layer, a third feature activation layer, a fifth feature convolutional layer, a feature output convolutional layer, and a feature output activation layer, used to fuse structural feature information and color feature information, recover the original resolution complementary color image from the fused features, and obtain the generated image.
[0011] Furthermore, the discriminator network includes: an initial reflection filling layer, a first convolutional layer, a first activation layer, multiple downsampling modules, a feature fusion layer, a reflection filling layer, and a convolutional layer connected in sequence. This network distinguishes the staining style and pathological information of the generated image from those of a real stained image. A true / false discrimination branch is used to determine whether the input image is a generated image, ensuring the authenticity and detail reproduction of the generated result, and outputting the slice authenticity discrimination result. Each downsampling module includes a reflection filling layer, a spectral normalization convolutional layer, and a LeakyReLU activation layer, with the number of channels increasing progressively to achieve feature abstraction. The feature fusion layer extracts features through dual-path global average pooling and global max pooling, and then performs channel compression through a 1x1 convolutional layer.
[0012] Further, S4 includes: Using the training dataset, the complementary color model is trained. The structure branch generator and the staining branch generator form an adversarial training framework with the discriminator during the training process. The generator improves the structural fidelity and staining consistency of the generated image by minimizing the adversarial loss, structure preservation loss and multi-level gradient constraint loss. The discriminator improves its ability to distinguish between real and generated images by maximizing the adversarial loss. Thus, the generator continuously optimizes the complementary color strategy during the training process, achieving high-precision complementary color reconstruction of faded pathological sections, and obtaining a well-trained complementary color model.
[0013] Furthermore, the expression for the loss function used to train the complementary color model is: ; ; ; ; ; ; ; in, This represents the loss of the generator network G. The weight parameters represent the resistance to loss. Indicating resistance to loss, The weight parameters represent the multi-scale gradient loss. This represents multi-scale gradient loss. The weight parameters represent the loss of structure preservation. Indicates structural retention loss. The weighting parameter represents the loss of color consistency. This indicates a loss of staining uniformity. Expressing expectations, This indicates the true / false output of the discriminator (used to combat loss). This represents the generated complementary color image. Represents the square of the L2 norm. This represents multi-scale gradient loss. Let s represent a true faded image, s represent a certain scale, and S represent the set of scales. The weighting parameter represents the scale. This represents the single-scale gradient loss. Let represent the number of pixels at the s-th scale, and i represent the pixel index. Describing the L1 norm, This represents the gradient operator in the horizontal direction. This represents the generated image at scale s. This represents the representation of a real image at scale s. Let l represent the gradient operator in the vertical direction, l represent a network layer, and L represent the set of network layers used to calculate the structural consistency loss. This indicates that a certain weight parameter of a network layer, Indicates the number of channels in the l network layer. Indicates the height of the l network layer. Indicates the width of the network layer. L1 norm, This represents the feature map of layer l. This represents the number of local windows, where 'c' represents a specific channel, and C represents the set of channels. Indicates mean weight, This represents the mean value of window i in channel c. Indicates the standard deviation weight. This represents the standard deviation of window i in channel c. This represents the loss of the discriminator D. It expresses expectation. Attached Figure Description
[0014] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein: Figure 1 This is an exemplary flowchart illustrating an artificial intelligence-based method for color correction of pathological slides, according to some embodiments of this specification. Detailed Implementation
[0015] The specific embodiments of the present invention are described below to enable those skilled in the art to understand the present invention. However, it should be understood that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, various changes are obvious as long as they are within the spirit and scope of the present invention as defined and determined by the appended claims. All inventions utilizing the concept of the present invention are protected.
[0016] Example Figure 1 This is an exemplary flowchart illustrating an artificial intelligence-based method for color correction of pathological sections, as shown in some embodiments of this specification. Figure 1 As shown, the process includes the following steps. In some embodiments, the process may be executed by a processor.
[0017] S1: Digitize the faded images and normal stained images of the same type of staining in the pathological sections to obtain the training dataset. The training dataset is an image dataset used to train the complementary color model. For example, the training dataset may include faded slice images and normally stained images.
[0018] S2: Standardize the faded slice images in the training dataset to obtain the target faded slice image.
[0019] The target decolorized slice image is a normalized decolorized slice image.
[0020] In some embodiments, the processor can perform standardization processing on the input faded slice image, including organizing region segmentation and patching operations, to obtain the target faded slice image.
[0021] S3: Construct a complementary color model.
[0022] The complementary color model is a neural network model used to complement faded images.
[0023] In some embodiments, the complementary color model may include a generator network and a discriminator network.
[0024] The generator network is used to extract features, restore color features, and fuse features from images in the training dataset to obtain generated images.
[0025] The generated image is a stained image generated by the complementary color model.
[0026] In some embodiments, the generator network may include a structural branch generator, a staining branch generator, and a feature fusion subnetwork; wherein the structural branch generator and the staining branch generator are parallel structures, the structural branch generator is used to extract tissue morphology and spatial structure information from the input tissue slice image, and the staining branch generator is used to extract the color distribution and texture features of the target staining style; by fusing the structural features output by the structural branch generator and the staining features output by the staining branch generator, staining style transfer is achieved on the original image while maintaining the tissue structure, resulting in a generated image.
[0027] The structural branch generator is used to extract cellular and tissue structural features from the training dataset using multi-scale convolution and residual block groups to obtain structural features.
[0028] Structural features are features that reflect the structural information of faded slice images.
[0029] In some embodiments, the processor can use multi-scale convolution and residual block groups to extract cell and tissue structural features while maintaining the integrity of tissue morphology; the input of the structural branch generator is the faded patch x∈R3×H×W, and the output is the structural feature s=Gs(x).
[0030] In some embodiments, the structural branch generator includes: an input image layer, a first convolutional layer, a first instance normalization layer, a first activation layer, a first downsampled reflection fill layer, a second convolutional layer, a second instance normalization layer, a second activation layer, a second downsampled reflection fill layer, a third convolutional layer, a third instance normalization layer, a third activation layer, and a residual block group connected in sequence; wherein, the residual block group consists of multiple standard residual blocks, each standard residual block includes two sub-blocks, and each sub-block is connected in sequence to the reflection fill layer, the convolutional layer, the instance normalization layer, and the activation layer within the residual block, ultimately outputting structural features.
[0031] In some embodiments, the structural branch generator includes, in sequence, an input image layer, a first convolutional layer (7×7, reflection padding 3), a first instance normalization layer, a first activation layer (ReLU), a first downsampled reflection padding layer (3×3, stride=2), a second convolutional layer, a second instance normalization layer, a second activation layer (ReLU), a second downsampled reflection padding layer (3×3, stride=2), a third convolutional layer, a third instance normalization layer, a third activation layer, and a residual block group. The residual block group consists of n_blocks standard residual blocks, each standard residual block including two sub-blocks. Each sub-block is sequentially connected to an intra-residual reflection padding layer, an intra-residual convolutional layer (3×3), an intra-residual instance normalization layer, and an intra-residual activation layer, ultimately outputting a structural feature map for subsequent feature fusion.
[0032] A coloring branch generator is used to adaptively recover coloring features from the training dataset by employing degradation-aware (SGN) residual block groups, fusing fading degree parameters and target coloring labels, and obtaining coloring features.
[0033] Staining features are features that reflect the staining information of faded section images.
[0034] In some embodiments, the processor may employ an SGN residual block group, fuse the fading degree parameter δ with the target staining label, and perform adaptive staining feature recovery to obtain staining features.
[0035] In some embodiments, the input to the staining branch generator is patch x ∈ R3×H×W, the degradation parameter δ, and the target staining label y. The output is the staining feature c = Gc(x,δ,y), which represents the staining component that has recovered the staining style. The degradation parameter is obtained by calculating the average color difference between the faded slice image and the reference staining image.
[0036] In some embodiments, the coloring branch generator includes: a coloring input layer, a first coloring convolutional layer, a first coloring degradation-aware normalization layer, a first coloring activation layer, a first coloring downsampled reflection-filling layer, a second coloring convolutional layer, a second coloring degradation-aware normalization layer, a second coloring activation layer, a second coloring downsampled reflection-filling layer, a third coloring convolutional layer, a third coloring degradation-aware normalization layer, a third coloring activation layer, and a degradation-aware residual block group; wherein the degradation-aware residual block group consists of multiple degradation-aware residual blocks, each degradation-aware residual block includes two sub-blocks, each sub-block sequentially including an intra-residual reflection-filling layer, an intra-residual convolutional layer, an intra-residual degradation-aware normalization layer, and an intra-residual activation layer, the degradation-aware normalization layer achieving adaptive complementary color adjustment by fusing fading degree parameters and target coloring labels through a dynamic style coding mechanism, adaptively restoring coloring features on the training dataset, and finally outputting coloring features.
[0037] In some embodiments, the staining branch generator includes, in sequence, a staining input layer, a staining first convolutional layer (7×7, reflection padding 3), a staining first degenerate perception normalization layer, a staining first activation layer (ReLU), a staining first downsampled reflection padding layer (3×3, stride=2), a staining second convolutional layer, a staining second degenerate perception normalization layer, a staining second activation layer (ReLU), a staining second downsampled reflection padding layer (3×3, stride=2), and a staining third convolutional layer. The system consists of a third degeneracy-aware normalization layer, a third activation layer (ReLU), and a group of degeneracy-aware residual blocks. The group of degeneracy-aware residual blocks consists of n_blocks degeneracy-aware residual blocks. Each degeneracy-aware residual block includes two sub-blocks. Each sub-block includes, in sequence, an intra-block reflection filling layer, an intra-block convolutional layer, an intra-block degeneracy-aware normalization layer, and an intra-block activation layer. The degeneracy-aware normalization layer achieves adaptive complementary color adjustment by fusing the fading degree parameter δ with the target color label through a dynamic style coding mechanism, and finally outputs a color feature map.
[0038] The feature fusion subnetwork is used to fuse structural feature information and coloring feature information to obtain the generated image.
[0039] In some embodiments, the feature fusion subnetwork fuses structural information s with coloring information c to obtain the final generated image.
[0040] In some embodiments, the feature fusion subnetwork includes: a feature input layer, a splicing layer, a first feature convolutional layer, a gated generation layer, a gated fusion computation unit, a second feature convolutional layer, a first feature activation layer, a first feature upsampling layer, a third feature convolutional layer, a first feature normalization layer, a second feature activation layer, a second feature upsampling layer, a fourth feature convolutional layer, a second feature normalization layer, a third feature activation layer, a fifth feature convolutional layer, a feature output convolutional layer, and a feature output activation layer, which are used to fuse structural feature information and coloring feature information, recover the original resolution complementary color image from the fused features, and obtain the generated image.
[0041] In some embodiments, the feature fusion network includes a feature input layer, a concatenation layer, a first feature convolutional layer (1×1), a gated generation layer (1×1 convolution + sigmoid, used to generate gate weights m), a gated fusion computation unit, a second feature convolutional layer (3×3), a first feature activation layer (ReLU), a first feature upsampling layer (nearest neighbor upsampling), a third feature convolutional layer, a first feature normalization layer (ILN), a second feature activation layer (ReLU), a second feature upsampling layer (nearest neighbor upsampling), a fourth feature convolutional layer, a second feature normalization layer (ILN), a third feature activation layer (ReLU), a fifth feature convolutional layer, a feature output convolutional layer (7×7), and a feature output activation layer (Tanh), used to recover the complementary color image of the original resolution from the fused features; the decoder simultaneously outputs multi-scale complementary color images (e.g., 1 / 4, 1 / 2, 1x resolution) at intermediate nodes of the upsampling process, so as to compute the multi-scale gradient constraint loss in parallel during training.
[0042] A discriminator network is used to distinguish the staining style and pathological information of the generated image to obtain the results of the slide authenticity judgment.
[0043] The slice authenticity judgment result reflects the similarity between the generated image and the real image.
[0044] In some embodiments, the discriminator network can determine whether the output image approximates the normal staining style and pathological information. The input is the generated image and the real image, and the output is the slide authenticity judgment result (true or false value).
[0045] In some embodiments, the discriminator network includes: an initial reflection filling layer, a first convolutional layer, a first activation layer, multiple downsampling modules, a feature fusion layer, a reflection filling layer, and a convolutional layer connected in sequence. This network distinguishes the staining style and pathological information of the generated image from those of a real stained image. It uses a true / false discrimination branch to determine whether the input image is a generated image, ensuring the authenticity and detail reproduction of the generated result, and outputs the slice authenticity discrimination result. Each downsampling module includes, in sequence, a reflection filling layer, a spectral normalization convolutional layer, and a LeakyReLU activation layer, with the number of channels increasing progressively to achieve feature abstraction. The feature fusion layer extracts features through dual-path global average pooling and global max pooling, and then performs channel compression through a 1x1 convolutional layer.
[0046] S4: Use the training dataset to train the complementary color model to obtain a trained complementary color model.
[0047] In some embodiments, the processor may employ generative adversarial loss, multi-level gradient constraint loss, structure preservation loss, and color consistency loss to jointly train the generator and discriminator networks. The discriminator network performs image authenticity discrimination, and the model outputs an interpretable attention heatmap to verify the model's attention regions.
[0048] In some embodiments, the processor can use a training dataset to train the complementary color model. The structure branch generator and the staining branch generator form an adversarial training framework with the discriminator during the training process. The generator improves the structural fidelity and staining consistency of the generated image by minimizing the adversarial loss, structure preservation loss and multi-level gradient constraint loss. The discriminator improves its ability to distinguish between real and generated images by maximizing the adversarial loss. This prompts the generator to continuously optimize the complementary color strategy during the training process, achieving high-precision complementary color reconstruction of faded pathological sections and obtaining a well-trained complementary color model.
[0049] In some embodiments, the expression for the loss function during the training of the complementary color model is: ; ; ; ; ; ; ; in, This represents the loss of the generator network G. The weight parameters represent the resistance to loss. Indicating resistance to loss, The weight parameters represent the multi-scale gradient loss. This represents multi-scale gradient loss. The weight parameters represent the loss of structure preservation. Indicates structural retention loss. The weighting parameter represents the loss of color consistency. This indicates a loss of staining uniformity. Expressing expectations, This indicates the true / false output of the discriminator (used to combat loss). This represents the generated complementary color image. Represents the square of the L2 norm. This represents multi-scale gradient loss. Let s represent a true faded image, s represent a certain scale, and S represent the set of scales. The weighting parameter represents the scale. This represents the single-scale gradient loss. Let represent the number of pixels at the s-th scale, and i represent the pixel index. Describing the L1 norm, This represents the gradient operator in the horizontal direction. This represents the generated image at scale s. This represents the representation of a real image at scale s. Let l represent the gradient operator in the vertical direction, l represent a network layer, and L represent the set of network layers used to calculate the structural consistency loss. This indicates that a certain weight parameter of a network layer, Indicates the number of channels in the l network layer. Indicates the height of the l network layer. Indicates the width of the network layer. L1 norm, This represents the feature map of layer l. This represents the number of local windows, where 'c' represents a specific channel, and C represents the set of channels. Indicates mean weight, This represents the mean value of window i in channel c. Indicates the standard deviation weight. This represents the standard deviation of window i in channel c. This represents the loss of the discriminator D. It expresses expectation.
[0050] S5: Use the trained complementary color model to process the target faded slice image to obtain complementary color image blocks.
[0051] Complementary color image patches are the target faded slice images output by the trained complementary color model.
[0052] In some embodiments, the processor can process the target faded slice image using a trained complementary color model. A structure branch generator is used, employing multi-scale convolution and residual block groups, to extract cellular and tissue structure features from the target faded slice image, obtaining structural features. A staining branch generator is used, employing residual block groups, fused fading degree parameters, and target staining labels, to adaptively restore staining features from the target faded slice image, obtaining staining features. A feature fusion subnetwork is used to fuse the structural and staining feature information to obtain complementary color image blocks.
[0053] S6: Stitch together the complementary color image blocks of the same slice to obtain the complementary color result, thus completing the complementary color of the pathological slice.
[0054] The complementary color result is the result of stitching together complementary color image patches.
[0055] In some embodiments, the processor can perform data processing operations such as segmentation and patching on the target faded slice image, input it into a trained dual-branch generator network, and generate corresponding complementary color image patches. Complementary color patches belonging to the same slice are stitched together to obtain the complete complementary color result, and the pathological region of interest of the model can be visualized through an attention heatmap.
[0056] In some embodiments of this specification, an artificial intelligence-based pathological slide color restoration method is provided. It adopts a dual-branch parallel architecture design. The structural branch generator focuses on maintaining the integrity of tissue morphology, while the staining branch generator realizes adaptive staining feature restoration, effectively solving the structural distortion problem common in traditional methods. This unique architecture design not only ensures the accurate preservation of cell and tissue structure, but also makes intelligent adjustments for different degrees of fading, making the color restoration effect more natural and reliable. (1) In terms of staining restoration technology, this method realizes intelligent processing of pathological slide fading by introducing an advanced degradation perception mechanism. This mechanism can automatically adjust the color restoration intensity according to the actual degree of fading of the slide, which can effectively repair severely fading areas and maintain the original features of slightly fading areas. At the same time, scientific numerical constraints ensure that the output results meet the standard requirements of pathological diagnosis, greatly improving the accuracy and applicability of staining restoration. (2) A multi-dimensional joint optimization training strategy is adopted. By comprehensively considering multiple key indicators such as tissue structure preservation, staining consistency, and image authenticity, comprehensive optimization is achieved during model training. This comprehensive optimization scheme not only ensures the structural accuracy of the generated images, but also ensures the coordination and naturalness of the staining effect, so that the final output results reach the professional-level quality standard. (3) A multi-dimensional joint optimization training strategy is adopted. By comprehensively considering multiple key indicators such as tissue structure preservation, staining consistency, and image authenticity, comprehensive optimization is achieved during the model training process. This comprehensive optimization scheme not only ensures the structural accuracy of the generated images, but also ensures the coordination and naturalness of the staining effect, so that the final output results reach the professional-level quality standard. (4) The unsupervised learning mode adopted greatly reduces the difficulty of data collection and can adapt to pathological slide data of different sources and different qualities. This flexible data requirement makes the technology easier to promote and apply in the actual medical environment, while maintaining a high-efficiency processing speed and demonstrating excellent engineering implementation value. Overall, this method shows obvious advantages in terms of technological advancement, clinical applicability, and engineering feasibility.
Claims
1. A method for color correction of pathological sections based on artificial intelligence, characterized in that, include: S1: Digitize the faded and normal stained images of the same type of staining in the pathological sections to obtain the training dataset; S2: Standardize the faded slice images in the training dataset to obtain the target faded slice image; S3: Construct a complementary color model; S4: Use the training dataset to train the complementary color model and obtain the trained complementary color model; S5: Use the trained complementary color model to process the target faded slice image to obtain complementary color image blocks; S6: Stitch together the complementary color image blocks of the same slice to obtain the complementary color result, thus completing the complementary color of the pathological slice.
2. The artificial intelligence-based pathological slide color restoration method according to claim 1, characterized in that, The complementary color model includes: The generator network is used to extract features, restore color features, and fuse features from images in the training dataset to obtain generated images. A discriminator network is used to distinguish the staining style and pathological information of the generated image to obtain the results of the slide authenticity judgment.
3. The artificial intelligence-based pathological slide color restoration method according to claim 2, characterized in that, The generator network includes: The structural branch generator is used to extract cellular and tissue structural features from the training dataset by employing multi-scale convolution and residual block groups to obtain structural features. A coloring branch generator is used to adaptively recover coloring features from the training dataset by using residual block groups, fusion fading degree parameters and target coloring labels, to obtain coloring features; A feature fusion subnetwork is used to fuse structural and staining features to obtain a generated image. The structural branch generator and the staining branch generator are parallel structures. The structural branch generator extracts the tissue morphology and spatial structure information from the input tissue slice image, while the staining branch generator extracts the color distribution and texture features of the target staining style. By fusing the structural features output by the structural branch generator and the staining features output by the staining branch generator, staining style transfer is achieved on the original image while preserving the tissue structure, resulting in a generated image.
4. The artificial intelligence-based pathological slide color correction method according to claim 3, characterized in that, The structural branch generator comprises, in sequence, an input image layer, a first convolutional layer, a first instance normalization layer, a first activation layer, a first downsampled reflection fill layer, a second convolutional layer, a second instance normalization layer, a second activation layer, a second downsampled reflection fill layer, a third convolutional layer, a third instance normalization layer, a third activation layer, and a residual block group; wherein, the residual block group consists of multiple standard residual blocks, each standard residual block includes two sub-blocks, and each sub-block is sequentially connected to the reflection fill layer, the convolutional layer, the instance normalization layer, and the activation layer within the residual block, ultimately outputting structural features.
5. The artificial intelligence-based pathological slide color restoration method according to claim 3, characterized in that, The coloring branch generator comprises, in sequence, a coloring input layer, a first coloring convolutional layer, a first coloring degradation-aware normalization layer, a first coloring activation layer, a first coloring downsampled reflection-filling layer, a second coloring convolutional layer, a second coloring degradation-aware normalization layer, a second coloring activation layer, a second coloring downsampled reflection-filling layer, a third coloring convolutional layer, a third coloring degradation-aware normalization layer, a third coloring activation layer, and a degradation-aware residual block group. The degradation-aware residual block group consists of multiple degradation-aware residual blocks, each of which includes two sub-blocks. Each sub-block sequentially includes an in-block reflection-filling layer, an in-block convolutional layer, an in-block degradation-aware normalization layer, and an in-block activation layer. The degradation-aware normalization layer uses a dynamic style coding mechanism to fuse the fading degree parameter with the target coloring label to achieve adaptive complementary color adjustment, adaptively recovering the coloring features of the training dataset, and finally outputting the coloring features.
6. The artificial intelligence-based pathological slide color restoration method according to claim 3, characterized in that, The feature fusion subnetwork comprises: a feature input layer, a splicing layer, a first feature convolutional layer, a gated generation layer, a gated fusion computation unit, a second feature convolutional layer, a first feature activation layer, a first feature upsampling layer, a third feature convolutional layer, a first feature normalization layer, a second feature activation layer, a second feature upsampling layer, a fourth feature convolutional layer, a second feature normalization layer, a third feature activation layer, a fifth feature convolutional layer, a feature output convolutional layer, and a feature output activation layer, which are used to fuse structural feature information and color feature information, recover the original resolution complementary color image from the fused features, and obtain the generated image.
7. The artificial intelligence-based pathological slide color restoration method according to claim 2, characterized in that, The discriminator network comprises: an initial reflection filling layer, a first convolutional layer, a first activation layer, multiple downsampling modules, a feature fusion layer, a reflection filling layer, and a convolutional layer connected in sequence. It distinguishes the staining style and pathological information of the generated image from the real staining image, and uses a true / false discrimination branch to determine whether the input image is a generated image, ensuring the authenticity and detail reproduction of the generated result, and outputting the slice authenticity discrimination result. Each downsampling module includes a reflection filling layer, a spectrum normalization convolutional layer, and a LeakyReLU activation layer in sequence, with the number of channels increasing progressively to achieve feature abstraction. The feature fusion layer extracts features through dual-path global average pooling and global max pooling, and performs channel compression through a 1x1 convolutional layer.
8. The artificial intelligence-based pathological slide color restoration method according to claim 1, characterized in that, S4 includes: Using the training dataset, the complementary color model is trained. The structure branch generator and the staining branch generator form an adversarial training framework with the discriminator during the training process. The generator improves the structural fidelity and staining consistency of the generated image by minimizing the adversarial loss, structure preservation loss and multi-level gradient constraint loss. The discriminator improves its ability to distinguish between real and generated images by maximizing the adversarial loss. Thus, the generator continuously optimizes the complementary color strategy during the training process, achieving high-precision complementary color reconstruction of faded pathological sections, and obtaining a well-trained complementary color model.
9. The artificial intelligence-based pathological slide color restoration method according to claim 1, characterized in that, The expression for the loss function used to train the complementary color model is: ; ; ; ; ; ; ; in, This represents the loss of the generator network G. The weight parameters represent the resistance to loss. Indicating resistance to loss, The weight parameters represent the multi-scale gradient loss. This represents multi-scale gradient loss. The weight parameters represent the loss of structure preservation. Indicates structural retention loss. The weighting parameter represents the loss of color consistency. This indicates a loss of staining uniformity. Expressing expectations, This indicates the true / false output of the discriminator (used to combat loss). This represents the generated complementary color image. Represents the square of the L2 norm. This represents multi-scale gradient loss. Let s represent a true faded image, s represent a certain scale, and S represent the set of scales. The weighting parameter represents the scale. This represents the single-scale gradient loss. Let represent the number of pixels at the s-th scale, and i represent the pixel index. Describing the L1 norm, This represents the gradient operator in the horizontal direction. This represents the generated image at scale s. This represents the representation of a real image at scale s. Let l represent the gradient operator in the vertical direction, l represent a network layer, and L represent the set of network layers used to calculate the structural consistency loss. This indicates that a certain weight parameter of a network layer, Indicates the number of channels in the l network layer. Indicates the height of the l network layer. Indicates the width of the network layer. L1 norm, This represents the feature map of layer l. This represents the number of local windows, where 'c' represents a specific channel, and C represents the set of channels. Indicates mean weight, This represents the mean value of window i in channel c. Indicates the standard deviation weight. This represents the standard deviation of window i in channel c. This represents the loss of the discriminator D. It expresses expectation.