WSI image preprocessing method and system

The WSI image preprocessing method addresses the challenges of high computational demands and staining inconsistencies by using data processing and the PatchGAN algorithm to enhance image quality and consistency, improving the accuracy and robustness of pathological image analysis.

CN119131790APending Publication Date: 2024-12-13GUANGZHOU KUNYUAN FANGQING MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411151879.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-21
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

WSI images face challenges due to their ultra-high resolution and large size, requiring high computing and memory resources, manual inspection is laborious and prone to errors, and staining inconsistencies across laboratories affect data standardization and model accuracy, necessitating large amounts of high-quality annotated data.

Method used

A WSI image preprocessing method involving data processing, cutting, and staining standardization using the PatchGAN algorithm, followed by data augmentation to enhance image quality and consistency.

Benefits of technology

Reduces manual workload and computational complexity, ensures consistent image features and color distribution, enhances model generalization, and improves accuracy and robustness for pathological image analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131790A_ABST
    Figure CN119131790A_ABST
Patent Text Reader

Abstract

The invention provides a WSI image preprocessing method and system, and the method comprises the following steps: firstly, obtaining an original WSI image, and then carrying out the data processing and cutting of the original WSI image, and obtaining a plurality of WSI image blocks; according to the process, the workload of manual operation is effectively reduced, subjective errors are reduced, and the calculation complexity and memory consumption are remarkably reduced. And then, based on a PatchGAN algorithm, carrying out dyeing standardization on the WSI image blocks so as to ensure the consistency of image features and color distribution and realize a highly unified dyeing effect. The standardized processing can significantly reduce the influence of the dyeing difference between different laboratories on the performance of the model, and improve the generalization ability of the model. And finally, performing data enhancement on the standardized WSI image blocks, increasing the data volume and enhancing the robustness of the model, so that the model can better deal with image deformation and noise in practical application. Through the preprocessing system, the quality and the consistency of the WSI image are improved, reliable data support is provided for subsequent analysis and processing, and finally the accuracy and the effect of the whole pathological image analysis system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image processing, and in particular to a WSI image preprocessing method and system. Background Art

[0002] In pathology, full-view digital slide (WSI) images, as an important foundation of digital pathology, are widely used in tumor detection, tissue analysis, clinical diagnosis and other fields. With their ultra-high resolution and large size, WSI images can capture the tiny details of tissues and provide rich image information for accurate diagnosis. However, due to these characteristics, WSI images also face many challenges in processing and analysis.

[0003] Since WSI images are usually composed of billions of pixels and the amount of data is huge, this places extremely high computing and memory requirements on storage and processing. In addition, manual inspection of WSI images is not only laborious and time-consuming, but also prone to subjective errors, making it difficult to ensure the accuracy of annotation. Although computer vision technology has been introduced to replace manual inspection, it usually requires a large amount of high-quality annotated data to achieve ideal performance. However, traditional annotation methods often lack accuracy and contain non-target areas or background information, which further affects the effectiveness of model training. Therefore, the performance and accuracy of existing computer vision models in pathological image analysis are difficult to meet clinical needs.

[0004] In the process of producing WSI images, different laboratories use different stains and staining methods, resulting in significant differences between images. This staining inconsistency not only increases the difficulty of data standardization, but may also cause distortion of tissue structure and texture, thereby affecting the accuracy of subsequent analysis. Existing staining standardization methods often fail to maintain the true characteristics and consistency of tissues when dealing with these differences, thereby reducing the generalization ability of pathology image analysis models.

[0005] Due to the diversity and staining inconsistency of pathological images, the training process of existing models requires a large amount of high-quality annotated data, which not only increases the annotation cost, but also places higher requirements on the experience and skills of pathologists. Current technology is difficult to effectively solve these problems, which limits the popularization and promotion of pathological image analysis models in actual clinical applications. Summary of the invention

[0006] The object of the present invention is to provide a WSI image preprocessing method and system, so as to at least solve the problem of how to improve the quality and consistency of WSI images through preprocessing.

[0007] In order to solve the above technical problems, the present invention provides a WSI image preprocessing method, comprising:

[0008] Get the original WSI image;

[0009] Performing data processing and cutting on the original WSI image to obtain several WSI image blocks;

[0010] Based on the PatchGAN algorithm, the WSI image patches are stained and standardized;

[0011] Data augmentation is performed on the WSI image blocks after dye normalization to obtain the preprocessed WSI image.

[0012] Optionally, in the WSI image preprocessing method, the method of performing data processing and cutting on the original WSI image to obtain a plurality of WSI image blocks includes:

[0013] The pixel-by-pixel polygon annotation method is used to annotate the original WSI image;

[0014] Unify the data format of the WSI images after data annotation into TIFF and / or XML;

[0015] The WSI image with unified segmentation format is segmented to remove the background and blurred areas and obtain the valid area;

[0016] The WSI image is cut based on the valid area to obtain several WSI image blocks.

[0017] Optionally, in the WSI image preprocessing method, the method of unifying the data format of the WSI image after data annotation into TIFF and / or XML includes:

[0018] The pathology data is unified into TIFF format. The case data names do not contain spaces and Chinese characters, and are not named with pure numbers. The case data names are unique and associated with the patient's ID.

[0019] The annotation data is uniformly saved in an annotation file in XML format, and the name of the annotation file is the same as the annotation data.

[0020] Optionally, in the WSI image preprocessing method, the method of segmenting the WSI image after the unified format to remove the background and the blurred area to obtain the effective area includes:

[0021] Convert the WSI image from RGB color space to HSV color space;

[0022] Apply a median blur to the saturation channel to smooth out the edges;

[0023] Threshold segmentation is performed based on the saturation channel to generate a binary mask;

[0024] Fill gaps and holes using morphological closing operations to optimize the binary mask;

[0025] Based on the area threshold, the optimized binary mask is filtered and detected to obtain the tissue area contour;

[0026] The image within the outline of the tissue region is extracted to obtain the effective region.

[0027] Optionally, in the WSI image preprocessing method, the method of cutting the WSI image based on the effective area to obtain a plurality of WSI image blocks includes:

[0028] The WSI image is cropped into several WSI image blocks at a preset magnification;

[0029] If the WSI image block does not contain a valid area, the WSI image block is discarded.

[0030] Optionally, in the WSI image preprocessing method, the method for performing coloring standardization on the WSI image blocks based on the PatchGAN algorithm includes:

[0031] Construct a dyeing standardization network architecture based on the PatchGAN model;

[0032] The WSI image patches are color-normalized using the color-normalization network architecture.

[0033] Optionally, in the WSI image preprocessing method, the method for constructing a dyeing standardization network architecture based on the PatchGAN model includes:

[0034] Build an image generator based on the UNet network, where the encoder layer and decoder layer are directly connected via skip connections;

[0035] Use the PatchGAN model as the discriminator of the color normalization network architecture;

[0036] Sets the loss function for the color normalization network architecture.

[0037] Optionally, in the WSI image preprocessing method, the loss function of the dye normalization network architecture is expressed as:

[0038]

[0039] Among them, G represents the generator and D represents the discriminator; Represents the loss function that enables cGAN to learn the mapping from input image to output image and train the mapping; The representation loss encourages the generator to generate samples similar to the conditioning variable x, and is the average of the absolute values ​​of the differences in each pixel between the training image x and the generated image G(zy); λ represents a hyperparameter that controls the weights of the generator.

[0040] Optionally, in the WSI image preprocessing method, before performing color standardization on the WSI image blocks using the color standardization network architecture, the method for performing color standardization on the WSI image blocks based on the PatchGAN algorithm includes:

[0041] The dye normalization network architecture was trained using the dataset.

[0042] Optionally, in the WSI image preprocessing method, the method of using the data set to train the dyeing standardization network architecture includes:

[0043] Obtain pathology datasets;

[0044] The pathology dataset was divided into a training cohort and a validation cohort by stratified sampling;

[0045] The dye normalization network architecture is trained using the training cohort, and the resulting generator is represented as:

[0046]

[0047] The trained color normalization network architecture was evaluated using the validation cohort.

[0048] Optionally, in the WSI image preprocessing method, the method of performing data enhancement on the WSI image block after dyeing and normalization to obtain the preprocessed WSI image includes:

[0049] Random undersampling is performed on WSI images with a large number of WSI image blocks, and random data enhancement is performed on WSI images with a small number of WSI image blocks, so that the number of obtained WSI image blocks reaches a preset number.

[0050] In order to solve the above technical problems, the present invention further provides a WSI image preprocessing system, which is used to implement the WSI image preprocessing method as described in any one of the above items, and the WSI image preprocessing system includes:

[0051] An image acquisition module, used to acquire original WSI images;

[0052] An image processing and cutting module is used to process and cut the original WSI image to obtain several WSI image blocks;

[0053] The dyeing normalization module is used to perform dyeing normalization on WSI image blocks based on the PatchGAN algorithm;

[0054] The data enhancement module is used to perform data enhancement on the WSI image blocks after dyeing and standardization to obtain the preprocessed WSI image.

[0055] The WSI image preprocessing method and system provided by the present invention include: obtaining an original WSI image; performing data processing and cutting on the original WSI image to obtain a plurality of WSI image blocks; performing dyeing standardization on the WSI image blocks based on the PatchGAN algorithm; and performing data enhancement on the WSI image blocks after dyeing standardization to obtain the preprocessed WSI image. Data processing and cutting can effectively reduce the workload of manual operation, reduce subjective errors, and significantly reduce the computational complexity and memory consumption. Dyeing standardization by the PatchGAN algorithm can ensure the consistency of image features and color distribution, and achieve a highly uniform dyeing effect. This standardization process can significantly reduce the impact of dyeing differences between different laboratories on model performance and improve the generalization ability of the model. By performing data enhancement on the standardized WSI image blocks, the data volume is increased and the robustness of the model is enhanced, so that it can better cope with image deformation and noise in practical applications. Through the preprocessing system, the quality and consistency of the WSI image are improved, reliable data support is provided for subsequent analysis and processing, and the accuracy and effect of the entire pathological image analysis system are finally improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 A flowchart of the WSI image preprocessing method provided in this embodiment;

[0057] Figure 2 The WSI image after data annotation provided in this embodiment;

[0058] Figure 3 A flowchart of the process of segmenting a WSI image provided in this embodiment;

[0059] Figure 4 A schematic diagram of the structure of the dyeing standardization network architecture provided in this embodiment;

[0060] Figure 5 A schematic diagram of the structure of the WSI image preprocessing system provided in this embodiment;

[0061] Figure 6 This is a comparison chart of the processing effects of the WSI image preprocessing method provided in this embodiment compared with the prior art. DETAILED DESCRIPTION

[0062] The WSI image preprocessing method and system proposed in the present invention are further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the accompanying drawings are all in a very simplified form and use non-precise proportions, which are only used to conveniently and clearly assist in explaining the purpose of the embodiments of the present invention. In addition, the structure shown in the accompanying drawings is often a part of the actual structure. In particular, the emphasis of each accompanying drawing is different, and sometimes different proportions are used.

[0063] It should be noted that the terms "first", "second", etc. in the specification, claims and drawings of the present invention are used to distinguish similar objects in order to describe the embodiments of the present invention, rather than to describe a specific order or sequence. It should be understood that the structures used in this way can be interchanged under appropriate circumstances. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0064] This embodiment provides a WSI image preprocessing method, such as Figure 1 As shown, including:

[0065] S1, obtain the original WSI image;

[0066] S2, performing data processing and cutting on the original WSI image to obtain a number of WSI image blocks;

[0067] S3, based on the PatchGAN algorithm, the WSI image blocks are stained and standardized;

[0068] S4, performing data enhancement on the WSI image block after dyeing normalization to obtain a preprocessed WSI image.

[0069] The preprocessing method and system of WSI images provided in this embodiment can effectively reduce the workload of manual operations, reduce subjective errors, and significantly reduce computational complexity and memory consumption through data processing and cutting. Staining standardization through the PatchGAN algorithm can ensure the consistency of image features and color distribution, and achieve a highly unified staining effect. This standardization process can significantly reduce the impact of staining differences between different laboratories on model performance and improve the generalization ability of the model. By performing data enhancement on the standardized WSI image blocks, the amount of data is increased and the robustness of the model is enhanced, so that it can better cope with image deformation and noise in practical applications. Through this preprocessing system, the quality and consistency of WSI images are improved, reliable data support is provided for subsequent analysis and processing, and ultimately the accuracy and effect of the entire pathological image analysis system are improved.

[0070] Specifically, in this embodiment, step S1, the original WSI image is obtained, wherein the original WSI image is usually large in size, and the image format can be different; the staining method and the agent can be different; the content and method of obtaining the WSI image required for different pathological analysis purposes can also be different. This application does not limit this.

[0071] Furthermore, in this embodiment, in step S2, the method of performing data processing and cutting on the original WSI image to obtain a plurality of WSI image blocks includes:

[0072] S21, using pixel-by-pixel polygon labeling method to label the original WSI image.

[0073] In this embodiment, the original WSI image is annotated with a pixel-by-pixel polygon annotation method to obtain an image such as Figure 2 As shown. Figure 2 It can be seen that the marked tumor areas (blue areas and red areas) are complete in appearance and do not contain other non-tumor areas, which is more in line with the actual situation. Compared with the traditional circumscribed circle or circumscribed rectangle annotation, the pixel-by-pixel polygon annotation method used in this embodiment is more accurate and reduces the inadvertent entry of background and other cells.

[0074] S22, unifying the data format of the WSI image after data annotation into TIFF and / or XML.

[0075] Since pathological image analysis needs to effectively utilize data collected in various ways, it is necessary to convert the data into a common format that can be understood by different tools and methods. Therefore, in this embodiment, various types of collected data are uniformly standardized:

[0076] The pathology data is unified into TIFF format. The case data names do not contain spaces and Chinese characters, and are not named with pure numbers. The case data names are unique and associated with the patient's ID.

[0077] The annotation data is uniformly saved in an annotation file in XML format, and the name of the annotation file is the same as the annotation data.

[0078] This ensures compatibility and consistency of data across different tools and methods.

[0079] S23, segmenting the WSI image in a unified format to remove the background and blurred areas to obtain a valid area.

[0080] Specifically, in this embodiment, if Figure 3As shown in the figure, first, the WSI image is converted from RGB color space to HSV color space; then, the median blur is applied to the saturation channel to smooth the edges; then, threshold segmentation is performed based on the saturation channel to generate a binary mask for identifying tissue areas; then, the morphological closing operation is used to fill the gaps and holes to optimize the binary mask; then, based on the area threshold, the optimized binary mask is filtered and detected to obtain the tissue area contour; finally, the image within the tissue area contour is extracted to obtain the valid area.

[0081] In this way, the background and blurred areas in the WSI image can be effectively distinguished, which reduces the workload of manual annotation and improves the processing efficiency of subsequent cutting of the WSI image.

[0082] S24, cutting the WSI image based on the valid area to obtain a plurality of WSI image blocks.

[0083] Specifically, in this embodiment, the WSI image is first cropped into several WSI image blocks at a preset magnification. For example, the WSI image is cropped into several WSI image blocks of 512×512 pixels at a magnification of 20 times, and the resolution of each pixel is 0.5μm. If the WSI image block does not contain a valid area, the WSI image block is discarded. In this way, the retained WSI image block contains a valid area, that is, a tumor tissue area that needs to be analyzed and processed, which can not only quickly segment the WSI image into WSI image blocks, but also retain useful information for subsequent pathological analysis, thereby improving computational efficiency while reducing resource consumption.

[0084] Furthermore, in this embodiment, step S3, based on the PatchGAN algorithm, the method for performing coloring standardization on the WSI image block includes:

[0085] S31, construct a coloring standardization network architecture based on the PatchGAN model.

[0086] Specifically, in this embodiment, an image generator is constructed based on a UNet network, in which the encoder layer and the decoder layer are directly connected via a jump connection. Since the jump connection can pass low-level information (usually shared between input and output images) through the bottleneck of the encoder-decoder network, the performance of the stain translation of the color normalization network architecture can be effectively improved.

[0087] The PatchGAN model is used as the discriminator of the dye standardization network architecture. In PatchGAN, instead of classifying the entire image together, each image is divided into n×n segments, and then each part is predicted to be true or false. Finally, the final classification is completed by averaging all the answers. In other words, only structures of a specific patch scale will be penalized. Therefore, using the PatchGAN model as a discriminator can effectively improve the dye standardization network architecture's ability to recognize and process dyes, especially to analyze the local features of the image in a more fine-grained manner, provide richer information, and improve the generalization ability of the image analysis model.

[0088] Set the loss function of the color normalization network architecture, where the loss function of the color normalization network architecture is expressed as:

[0089]

[0090] Among them, G represents the generator and D represents the discriminator; Represents the loss function that enables cGAN to learn the mapping from input image to output image and train the mapping; The representation loss encourages the generator to generate samples similar to the conditional variable x, and is the average of the absolute values ​​of the differences between each pixel in the training image x and the generated image G(zy); λ represents a hyperparameter that controls the weights of the generator, which is updated by the adversarial loss of the discriminator output and the L1 loss of the re-dyed image output, and is set to 100 by default.

[0091] The dyeing standardization network architecture based on the PatchGAN model provided in this embodiment is as follows Figure 4 As shown, it mainly includes building an image generator based on the UNet network and a discriminator using the PatchGAN model.

[0092] S32, the dye normalization network architecture is trained using the dataset.

[0093] Specifically, in this embodiment, first, a pathology data set is obtained. Then, the pathology data set is divided into a training cohort and a validation cohort by stratified sampling, wherein the training cohort may account for 80% and the validation cohort may account for 20%. Then, the training cohort is used to train the dye standardization network architecture. During the training, the hyperparameter λ is minimized for training the generator and maximized for training the discriminator. That is, the purpose of the training is to find a generator obtained by solving the optimization problem, which is expressed as:

[0094]

[0095] Finally, the trained color normalization network architecture was evaluated using a validation cohort.

[0096] S33, color normalization is performed on the WSI image patches using the color normalization network architecture.

[0097] In this way, the staining standardization method based on PatchGAN can enhance the image staining color, reduce the impact of staining color on the generalization ability of the model, ensure the consistency of image features and color distribution, and reduce the tissue structure and texture distortion problems caused by different stains and staining methods; through data processing steps, complex and large-scale image data are converted into WSI image blocks of uniform size and standard color, which is conducive to subsequent case analysis.

[0098] Furthermore, in order to solve the problem of unbalanced number of WSI image blocks, in this embodiment, in step S4, the method of performing data enhancement on the WSI image blocks after dyeing and normalization to obtain the preprocessed WSI image includes:

[0099] Random undersampling is performed on WSI images with a large number of WSI image blocks, and random data enhancement is performed on WSI images with a small number of WSI image blocks, so that the number of obtained WSI image blocks reaches a preset number.

[0100] In practical applications, data enhancement methods include rotation, flipping, scaling, cropping, blurring, Gaussian noise, salt and pepper noise, etc. At the same time, considering the quadratic complexity of the self-attention mechanism and the large number of WIS image blocks obtained by cutting each WSI image, and the GPU capacity is limited by hardware resources (usually 24GB), the number of WIS image blocks for each label can be set to 10,000.

[0101] The specific implementation method of data enhancement is as follows:

[0102] Random cropping: Randomly crop a portion of the image from the original image as new training data. When cropping, the cropping position and cropping size can be randomly selected to increase the diversity of the data. The cropping operation can be expressed by the following formula:

[0103] I crop =I org (x:x+w,y:y+h)

[0104] Among them, I org represents the original image, I crop Represents the cropped image, (x, y) represents the starting position of the crop, and w and h represent the width and height of the crop.

[0105] Random flipping: Randomly flip the original image horizontally or vertically to increase the diversity of the data. The flipping operation can be expressed by the following formula:

[0106]

[0107] Among them, I org represents the original image, I flip Represents the flipped image, w and h represent the width and height of the image, and (x, y) represents the coordinates of the pixel.

[0108] Random rotation: Randomly rotate the original image by a certain angle to increase the diversity of the data. The rotation operation can be expressed by the following formula:

[0109] I rotate =rotate(I org ,θ)

[0110] Among them, I org represents the original image, I rotate represents the rotated image, and θ represents the rotation angle.

[0111] Scaling: Scale the original image to a fixed size to facilitate feature extraction. The scaling operation can be expressed by the following formula:

[0112] I scale = resize(I org ,(w′,h′))

[0113] Among them, I org represents the original image, I scale represents the scaled image, w′ and h′ represent the scaled width and height.

[0114] Random brightness adjustment: Randomly adjust the brightness of the original image to increase the diversity of the data. The brightness adjustment operation can be expressed by the following formula:

[0115] I brightness =I org +Δb

[0116] Among them, I org represents the original image, I brightness represents the image after brightness adjustment, and Δb represents the change in brightness.

[0117] Of course, in practical applications, other methods can also be used for data enhancement. The specific implementation methods are well known to those skilled in the art and will not be described in detail in this application.

[0118] This embodiment also provides a WSI image preprocessing system, which is used to implement the WSI image preprocessing method described above. Figure 5 As shown, the WSI image preprocessing system includes:

[0119] An image acquisition module, used to acquire original WSI images;

[0120] An image processing and cutting module is used to process and cut the original WSI image to obtain several WSI image blocks;

[0121] The dyeing normalization module is used to perform dyeing normalization on WSI image blocks based on the PatchGAN algorithm;

[0122] The data enhancement module is used to perform data enhancement on the WSI image blocks after dyeing and standardization to obtain the preprocessed WSI image.

[0123] The WSI image preprocessing method and system provided in this embodiment can effectively reduce the workload of manual operations, reduce subjective errors, and significantly reduce computational complexity and memory consumption through data processing and cutting. Staining standardization through the PatchGAN algorithm can ensure the consistency of image features and color distribution, and achieve a highly uniform staining effect. This standardization process can significantly reduce the impact of staining differences between different laboratories on model performance and improve the generalization ability of the model. By performing data enhancement on the standardized WSI image blocks, the data volume is increased and the robustness of the model is enhanced, so that it can better cope with image deformation and noise in practical applications. Through this preprocessing system, the quality and consistency of WSI images are improved, which provides reliable data support for subsequent analysis and processing, and ultimately improves the accuracy and effectiveness of the entire pathological image analysis system. It solves the problem of how to improve the quality and consistency of WSI images through preprocessing

[0124] The WSI image preprocessing method provided in this embodiment is compared with several common existing WSI image preprocessing methods to illustrate the advantages of the WSI image preprocessing method provided in this embodiment over the existing technology.

[0125] In this embodiment, if Figure 6 As shown, the image corresponding to PatchGAN is the image obtained by processing the original image using the WSI image preprocessing method provided in this embodiment; Vahadane, Khan, Macenko and Reinhard are all images obtained by processing the original image using the currently commonly used WSI image preprocessing method.

[0126] By comparison, the test results are shown in Table 1:

[0127]

[0128] Table 1. AUC values ​​of images obtained by WSI image preprocessing method

[0129] It can be seen from Table 1 that the image AUC value obtained by the WSI image preprocessing method provided in this embodiment is closest to 1, which means that the WSI image preprocessing method provided in this embodiment has higher detection authenticity than the prior art.

[0130] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other. In addition, the different parts between the various embodiments can also be used in combination with each other, and the present invention is not limited to this.

[0131] The WSI image preprocessing method and system provided in this embodiment include: obtaining the original WSI image; performing data processing and cutting on the original WSI image to obtain a number of WSI image blocks; performing dyeing standardization on the WSI image blocks based on the PatchGAN algorithm; and performing data enhancement on the WSI image blocks after dyeing standardization to obtain the preprocessed WSI image. Data processing and cutting can effectively reduce the workload of manual operations, reduce subjective errors, and significantly reduce computational complexity and memory consumption. Dyeing standardization through the PatchGAN algorithm can ensure the consistency of image features and color distribution and achieve a highly uniform dyeing effect. This standardization process can significantly reduce the impact of dyeing differences between different laboratories on model performance and improve the generalization ability of the model. By performing data enhancement on the standardized WSI image blocks, the data volume is increased and the robustness of the model is enhanced, so that it can better cope with image deformation and noise in practical applications. Through this preprocessing system, the quality and consistency of the WSI image are improved, and reliable data support is provided for subsequent analysis and processing, ultimately improving the accuracy and effect of the entire pathological image analysis system. The problem of how to improve the quality and consistency of WSI images through preprocessing is solved

[0132] The above description is only a description of the preferred embodiments of the present invention, and is not intended to limit the scope of the present invention. Any changes or modifications made by a person skilled in the art in the field of the present invention based on the above disclosure shall fall within the scope of protection of the claims.

Claims

1. A WSI image preprocessing method, characterized in that: include: Get the original WSI image; Performing data processing and cutting on the original WSI image to obtain several WSI image blocks; Based on the PatchGAN algorithm, the WSI image patches are stained and standardized; Data augmentation is performed on the WSI image blocks after dye normalization to obtain the preprocessed WSI image.

2. The WSI image preprocessing method according to claim 1, characterized in that: The method of performing data processing and cutting on the original WSI image to obtain a plurality of WSI image blocks includes: The pixel-by-pixel polygon annotation method is used to annotate the original WSI image; Unify the data format of the WSI images after data annotation into TIFF and / or XML; The WSI image with unified segmentation format is segmented to remove the background and blurred areas and obtain the valid area; The WSI image is cut based on the valid area to obtain several WSI image blocks.

3. The WSI image preprocessing method according to claim 2, characterized in that: The method for unifying the data format of the WSI image after data annotation into TIFF and / or XML includes: The pathology data is unified into TIFF format. The case data names do not contain spaces and Chinese characters, and are not named with pure numbers. The case data names are unique and associated with the patient's ID. The annotation data is uniformly saved in an annotation file in XML format, and the name of the annotation file is the same as the annotation data.

4. The WSI image preprocessing method according to claim 2, characterized in that: The method for removing the background and the blurred area from the WSI image after segmentation in a unified format to obtain the effective area includes: Convert the WSI image from RGB color space to HSV color space; Apply a median blur to the saturation channel to smooth out the edges; Threshold segmentation is performed based on the saturation channel to generate a binary mask; Fill gaps and holes using morphological closing operations to optimize the binary mask; Based on the area threshold, the optimized binary mask is filtered and detected to obtain the tissue area contour; The image within the outline of the tissue region is extracted to obtain the effective region.

5. The WSI image preprocessing method according to claim 2, characterized in that: The method of cutting the WSI image based on the effective area to obtain a plurality of WSI image blocks includes: The WSI image is cropped into several WSI image blocks at a preset magnification; If the WSI image block does not contain a valid area, the WSI image block is discarded.

6. The WSI image preprocessing method according to claim 1, characterized in that: The method for performing coloring standardization on WSI image blocks based on the PatchGAN algorithm includes: Construct a dyeing standardization network architecture based on the PatchGAN model; The WSI image patches are color-normalized using the color-normalization network architecture.

7. The WSI image preprocessing method according to claim 6, characterized in that: The method for constructing a dyeing standardization network architecture based on the PatchGAN model includes: Build an image generator based on the UNet network, where the encoder layer and decoder layer are directly connected via skip connections; Use the PatchGAN model as the discriminator of the color normalization network architecture; Sets the loss function for the color normalization network architecture.

8. The WSI image preprocessing method according to claim 7, characterized in that: The loss function of the dye normalization network architecture is expressed as: Among them, G represents the generator and D represents the discriminator; Represents the loss function that enables cGAN to learn the mapping from input image to output image and train the mapping; The representation loss encourages the generator to generate samples similar to the conditioning variable x, and is the average of the absolute values ​​of the differences in each pixel between the training image x and the generated image G(zy); λ represents a hyperparameter that controls the weights of the generator.

9. The WSI image preprocessing method according to claim 8, characterized in that: Before using the color normalization network architecture to perform color normalization on the WSI image block, the method for performing color normalization on the WSI image block based on the PatchGAN algorithm includes: The dye normalization network architecture was trained using the dataset.

10. The WSI image preprocessing method according to claim 9, characterized in that: The method for training the dyeing standardization network architecture using the data set includes: Obtain pathology datasets; The pathology dataset was divided into a training cohort and a validation cohort by stratified sampling; The dye normalization network architecture is trained using the training cohort, and the resulting generator is represented as: The trained color normalization network architecture was evaluated using the validation cohort.

11. The WSI image preprocessing method according to claim 1, characterized in that: The method of performing data enhancement on the dyed and standardized WSI image block to obtain a preprocessed WSI image includes: Random undersampling is performed on WSI images with a large number of WSI image blocks, and random data enhancement is performed on WSI images with a small number of WSI image blocks, so that the number of obtained WSI image blocks reaches a preset number.

12. A WSI image preprocessing system, used to implement the WSI image preprocessing method according to any one of claims 1 to 11, characterized in that: The WSI image preprocessing system includes: An image acquisition module, used to acquire original WSI images; An image processing and cutting module is used to process and cut the original WSI image to obtain several WSI image blocks; The dyeing normalization module is used to perform dyeing normalization on WSI image blocks based on the PatchGAN algorithm; The data enhancement module is used to perform data enhancement on the WSI image blocks after dyeing and standardization to obtain the preprocessed WSI image.