Machine learning techniques for detecting artifact pixels in images
The method addresses inefficiencies in artifact detection by using pre-processing algorithms and U-Net models at varying image resolutions, enhancing the accuracy and efficiency of digital pathology analysis.
Patent Information
- Application Number
- JP2024521189
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-10-15
- Filing Date
- 2022-10-07
- Publication Date
- 2024-10-23
- Estimated Expiration
- 2042-10-07
AI Technical Summary
Existing machine learning models for detecting artifact pixels in images, such as those used in digital pathology, face challenges in generating accurate training data efficiently, handling various staining patterns, and integrating artifact detection into digital pathology analysis without significant computing resource consumption and increased processing time.
A method involving image pre-processing algorithms to generate initial labels, using U-Net machine learning models with convolutional layers, and applying these models at different image resolutions to efficiently detect artifact pixels, reducing processing time and resource consumption.
The method enables accurate and efficient detection of artifact pixels across various staining patterns and image resolutions, improving the quality of digital pathology analysis by reducing processing time and resource consumption.
Smart Images

Figure 2024538739000001_ABST
Abstract
Description
[Technical field]
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS This application claims priority to U.S. Provisional Patent Application No. 63 / 256,328, entitled “Machine-Learning Techniques For Detecting Artifact Pixels In Images,” filed October 15, 2021, the contents of which are incorporated by reference in their entirety for all purposes. [Background technology]
[0002] 2. Background of the Invention Immunohistochemistry (IHC) assays allow visualization and quantification of biomarker locations, which play an important role in both cancer diagnosis and oncology research. In addition to the "gold-standard" DAB (3,3'-diaminobenzidine)-based IHC assays, advances have been made in recent years in both bright-field multiplexed IHC assays and multi-fluorescent IHC assays. These multiplexed IHC assays can be used, among other things, to identify multiple biomarkers in the same slide image. Such assays not only improve the efficiency in identifying biomarkers in a single slide, but also facilitate the identification of additional properties associated with such biomarkers (e.g., co-localized biomarkers).
[0003] Quality control of slide images can be performed to improve performance and reduce errors in digital pathology analysis. In particular, quality control allows accurate detection of diagnostic or prognostic biomarkers from slide images by digital pathology analysis. Quality control may include, among others, detecting and excluding pixels that are predicted to depict one or more image artifacts in the slide image. Artifacts can include tissue folds, foreign bodies, blurred image portions, and any other distortions that prevent accurate display of the corresponding region of the biological sample. For example, tissue folds present in the biological sample can blur one or more portions of the image. These artifacts can cause errors or inaccurate results in subsequent digital pathology analysis. For example, artifacts detected in the slide image can cause the digital pathology analysis to erroneously count the number of cells detected or to erroneously identify a group of tumor cells as normal. In fact, artifacts can cause an inaccurate diagnosis of a subject associated with the slide image. Summary of the Invention
[0004] overview In some embodiments, a method for generating training data for training a machine learning model to detect expected artifacts in an image is provided. The method can include accessing an image displaying at least a portion of a biological sample. Additionally, the method can include applying an image pre-processing algorithm to the image to generate a pre-processed image. In some cases, the pre-processed image includes a plurality of labeled pixels. Each labeled pixel of the plurality of labeled pixels can be associated with a label that predicts whether the pixel accurately displays a corresponding point or region of at least a portion of the biological sample.
[0005] Further, the method may include applying a machine learning model to the preprocessed image to identify one or more labeled pixels from the plurality of labeled pixels. In some cases, the one or more labeled pixels are predicted to be mislabeled by the image preprocessing algorithm. Further, the method may include modifying a label for each of the one or more labeled pixels. Further, the method may further include generating a training image including at least the one or more labeled pixels with the modified label. Further, the method may include outputting the training image.
[0006] In some embodiments, a method is provided for training a machine learning model to detect expected artifacts in an image at a target image resolution. The method can include accessing training images displaying at least a portion of a biological sample. In some cases, the training images include a plurality of labeled pixels, each labeled pixel of the plurality of labeled pixels having an associated label that predicts whether the pixel accurately displays a corresponding point or region of the at least a portion of the biological sample.
[0007] Further, the method can include accessing a machine learning model including a set of convolution layers. In some cases, the machine learning model is configured to apply each convolution layer of the set of convolution layers to a feature map representing the input image. Further, the method can include training the machine learning model to detect one or more artifact pixels in the image at the target image resolution. In some cases, the artifact pixel of the one or more artifact pixels is predicted to not accurately represent a point or region of at least a portion of the biological sample.
[0008] In some cases, the training includes, for each labeled pixel of the plurality of labeled pixels of the training image, (i) determining a first loss for the labeled pixel at the first image resolution by applying a first convolutional layer of the set of convolutional layers to a first feature map representing the training image at the first image resolution, (ii) determining a second loss for the labeled pixel at the second image resolution by applying a second convolutional layer of the set of convolutional layers to a second feature map representing the training image at the second image resolution, the second resolution having a higher image resolution relative to the first image resolution, (iii) determining a total loss for the labeled pixel based on the first loss and the second loss, and (iv) determining that the machine learning model is trained to detect one or more artifact pixels at the target image resolution based on the total loss. Further, the method may include outputting the trained machine learning model.
[0009] In some embodiments, a method is provided for using a machine learning model to detect predicted artifacts in a target image resolution. The method can include accessing an image displaying at least a portion of a biological sample, the image being at a first image resolution. Further, the method can include accessing a machine learning model trained to detect artifact pixels in the image at a second image resolution. In some cases, the first image resolution has a higher image resolution relative to the second image resolution.
[0010] The method may further include transforming the image to generate a transformed image that displays at least a portion of the biological sample at a second image resolution. The method may further include applying a machine learning model to the transformed image to identify one or more artifact pixels from the transformed image. In some cases, the artifact pixels of the one or more artifact pixels are predicted to not accurately represent a point or region of at least a portion of the biological sample. The method may further include generating an output that includes the one or more artifact pixels.
[0011] Some embodiments of the present disclosure include a system including one or more data processors. In some embodiments, the system includes a non-transitory computer-readable storage medium including instructions that, when executed on the one or more data processors, cause the one or more data processors to perform some or all of the methods and / or some or all of the processes disclosed herein. Some embodiments of the present disclosure include a computer program product tangibly embodied in a non-transitory machine-readable storage medium, including instructions configured to cause the one or more data processors to perform some or all of the methods and / or some or all of the processes disclosed herein.
[0012] The terms and expressions used are used as terms of description and not of limitation, and in the use of such terms and expressions there is no intention to exclude any equivalents of the features shown and described or portions thereof, but it is understood that various modifications are possible within the scope of the invention as claimed. Thus, although the invention as claimed has been specifically disclosed by embodiments and optional features, it is to be understood that modifications and variations of the concepts disclosed herein may be made by those skilled in the art, and such modifications and variations are considered to be within the scope of the invention as defined by the appended claims.
[0013] The patent or application file contains at least one drawing executed in color. Copies of this patent or patent application publication with color drawing(s) will be provided by the Office upon request and payment of the necessary fee.
[0014] The features, embodiments, and advantages of the present disclosure will be better understood from the following detailed description when considered in conjunction with the accompanying drawings. [Brief description of the drawings]
[0015] [Figure 1] 1 shows an example set of images including artifact pixels. [Diagram 2] 1 shows a flowchart illustrating an example process for generating training data according to some embodiments. [Diagram 3] 1 shows a flowchart illustrating an example process for using a machine learning model to generate training data according to some embodiments. [Figure 4] 1 illustrates an example set of images for which labels are generated according to some embodiments. [Diagram 5] 1 shows an example image including image portions each exhibiting different levels of blur. [Figure 6] 1 shows an exemplary set of images including one or more tissue folds in corresponding biological samples. [Figure 7] 1 shows an exemplary schematic diagram for generating training data for tissue fold regions according to some embodiments. [Figure 8] 1 includes a set of exemplary three-class tissue fold masks according to some embodiments. [Figure 9] An exemplary image (eg, FOV) is shown that includes a tissue fold region, which displays both unblurred and blurred regions of the tissue fold region. [Figure 10] 1 shows an example set of images displaying various artifact regions. [Figure 11] 4 illustrates an example artifact mask generated using a composite artifact classification technique according to some embodiments. [Figure 12] 13 illustrates a further artifact mask using a composite artifact classification technique according to some embodiments. [Figure 13] 1 illustrates a slide image with two or more classification labels associated with pixels according to some embodiments. [Figure 14] 1 illustrates a process for identifying classification labels for pixels associated with both blurred and tissue fold regions according to some embodiments. [Figure 15] 13 illustrates a comparison between predicted classifications with ground truth masks according to some embodiments. [Figure 16] 1 shows prediction regions in slide images from different types of IHC assays according to some embodiments. [Figure 17] An exemplary set of images is shown, where each image has been stained using a staining protocol corresponding to a particular type of IHC assay. [Figure 18] FIG. 1 shows a schematic diagram illustrating an example architecture used to train a machine learning model to detect artifacts in images in accordance with some embodiments. [Figure 19] 1 shows a flowchart illustrating an example process for training a machine learning model to accurately detect artifact pixels according to some embodiments. [Figure 20] 1 shows a flowchart illustrating a process for training a machine learning model for detecting artifact regions in slide images according to some embodiments. [Figure 21] 1 shows a flowchart illustrating an example process for using a trained machine learning model to accurately detect artifact pixels in accordance with some embodiments. [Figure 22]1 shows an example set of graphs identifying precision and recall scores for a machine learning model trained to detect artifact pixels. [Diagram 23] 1 shows a set of exemplary image masks generated for a set of blind images from the same type of assay and the same type of tissue as the training images. [Figure 24] 1 shows a set of exemplary image masks generated from images displaying hidden assay patterns or tissue types. [Diagram 25] 1 illustrates an example of a computer system for implementing some embodiments disclosed herein. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0016] Detailed Description I. Overview The following examples are provided to introduce certain embodiments. In the following description, for purposes of explanation, specific details are set forth to provide a thorough understanding of the examples of the present disclosure. However, it will be apparent that various examples may be practiced without these specific details. For example, devices, systems, structures, assemblies, methods, and other components may be shown as components in block diagram form so as not to obscure the examples in unnecessary detail. In other cases, well-known devices, processes, systems, structures, and techniques may be shown without necessary details so as not to obscure the examples. The drawings and description are not intended to be limiting. The terms and expressions used in this disclosure are used as terms of description rather than limitation, and the use of such terms and expressions is not intended to exclude equivalents of the features shown and described or portions thereof. The term "example" is used herein to mean "serve as an example, instance, or illustration." Any embodiment or design described herein as an "example" should not necessarily be construed as preferred or advantageous over other embodiments or designs.
[0017] Several techniques for detecting artifacts have been used for quality control of slide images. An exemplary technique may include observing a given image and manually identifying sets of pixels within the image that are predicted to display one or more artifacts. However, manual identification of artifacts can be time consuming. The manual process relies heavily on experts to inspect each image and accurately determine whether the image contains artifacts. Furthermore, the classification of a particular type of artifact may be subjective and vary from expert to expert. For example, a first expert may label a set of pixels in a slide image as representing a blurred tissue region, while a second expert may label the same set of pixels in the same slide image as a non-blurred tissue region. Such possible discrepancies in artifact identification may reduce the accuracy of subsequent digital pathology analysis.
[0018] As an alternative to manual identification, machine learning models can predict which pixels display artifacts. Although these machine learning models have been successful in detecting certain types of artifacts, their accuracy is constrained due to several factors. For example, the factors may be due to existing training techniques, such as: (1) inability to efficiently generate accurate training data, (2) inability to efficiently train machine learning models to accurately detect artifacts in images with various staining patterns, and (3) inability to incorporate artifact detection machine learning models into subsequent digital pathology analysis (e.g., cell classification models, image segmentation techniques) while minimizing the increase in processing time and consumption of computing resources. In fact, existing machine learning models typically require significant computing resources and processing time for training and testing. Furthermore, using existing machine learning models to detect artifacts can significantly increase processing time and consume a large amount of computing resources for subsequent digital pathology analysis (e.g., cell classification). As described in detail below, embodiments of the present application can address each of the three factors to optimize the performance and increase the efficiency of artifact detection.
[0019] A. Generating training data A first factor that can impair accurate artifact detection by machine learning models includes existing training techniques that fail to efficiently generate accurate training data. Existing techniques can include manually annotating sets of pixels in images that may not accurately represent corresponding portions of a biological specimen. However, manually annotating artifacts in slide images can be time consuming. This problem can be exacerbated when machine learning models require large amounts of training data to achieve acceptable performance levels.
[0020] In addition to the above, manual annotation may result in inconsistent training data. Typically, several experts are involved in the manual annotation of images to generate training data. As mentioned above, each expert may have a different perspective on how a given set of pixels in an image is considered blurred, especially when the image includes pixels with various levels of blur. For a particular set of pixels in an image, the annotation from a first expert (e.g., non-blurred pixels) may be opposite to the annotation from a second expert (e.g., blurred pixels). Such differences in perspective may cause inconsistencies in the training data. Inconsistencies may result in machine learning models being trained to perform less than optimal levels of accuracy. Therefore, there is a need to generate consistent and accurate training data while reducing the time for generation.
[0021] To address the above challenges, some embodiments use techniques to generate a label for each pixel of an image that identifies whether the pixel accurately represents a corresponding point or region of a (e.g., stained) biological sample. The label can then be used as training data for training a machine learning model. In some cases, the label identifies whether the pixel represents at least a portion of a blurred image portion of the image. A pixel associated with a "blurred" label can be determined by estimating the amount of blur of the pixel and comparing the estimate to a blur threshold. As used herein, the term "blur threshold" corresponds to a blur level that is predicted to result in a performance degradation of a classification model that exceeds an acceptable threshold. If the estimate exceeds the blur threshold, the label can indicate that the corresponding pixel does not accurately represent the corresponding point or region of the biological sample. In some cases, the blur threshold is determined by performing a digital pathology analysis of other images of a particular blur level, determining that the output of the digital pathology analysis produces results that are below an acceptable threshold (e.g., the amount of misclassified pixels), and setting this particular blur level as the blur threshold.
[0022] The technique can include using an image preprocessing algorithm to generate a set of initial labels and a machine learning model to modify the set of initial labels. For example, image blur detection can be applied to the image to generate a preprocessed image. The preprocessed image can identify an initial label for each pixel of the image. A machine learning model can be applied to the preprocessed image to modify the label of each of the set of mislabeled pixels. The image having the set of pixels with the modified labels can be used as a training image for training a model for detecting artifacts in an image.
[0023] B. Training a machine learning model to accurately detect artifact pixels The second factor that may impair accurate artifact detection of machine learning models corresponds to existing training techniques that cannot efficiently train machine learning models to detect artifacts in images with various staining patterns. In particular, multiple stains corresponding to a particular type of IHC assay (e.g., Ki67 IHC assay) may be applied to a tissue sample to determine a particular diagnosis or prognosis of a subject. Images displaying such tissue samples may exhibit distinct staining patterns.
[0024] Recent developments in IHC assay technology have facilitated the detection of multiple biomarkers in a single image. For example, fluorescence-based IHC assays may use multispectral imaging to separate several different fluorescence spectra, which allows for accurate identification of multiple antigens on the same tissue section. However, in these multiplex IHC assays, more complex staining patterns may occur compared to single IHC assays (e.g., IHC assays targeting a single type of antigen). However, training a single machine learning model to detect artifacts across images with complex staining patterns may be difficult, especially when various types of IHC assays are considered. Existing techniques may include training a machine learning model with a first set of training images corresponding to a first type of assay, and then training the machine learning model with a second set of training images corresponding to a second type of assay. In some cases, the machine learning model is trained with a set of training images collected from several IHC assays under study. These techniques may lead to time-consuming labeling and training processes. Therefore, there is a need to efficiently train a machine learning model to detect artifacts in images with various staining patterns.
[0025] To address the above challenges, some embodiments include techniques for training a machine learning model to detect artifacts in images having various staining patterns. The techniques can include accessing training images displaying at least a portion of a biological sample. The training images include a plurality of labeled pixels, each pixel having a label associated therewith. The labels predict whether the pixels accurately display a corresponding point or region of at least a portion of the biological sample. For example, pixels displaying an out-of-focus region of the biological sample can be labeled as not accurately displaying the corresponding region.
[0026] In some cases, the training image is converted to a grayscale image. The grayscale image is used to train machine learning to detect artifact pixels. As used herein, an "artifact pixel" refers to a pixel that is predicted not to accurately represent a corresponding point or region of at least a portion of a biological sample. In some cases, the artifact pixel is predicted to represent at least a portion of an artifact. For example, the artifact pixel can be predicted to represent a portion of a blurred portion of a given image, or to represent a portion of a foreign object (e.g., a hair, a dust particle, a fingerprint) shown in the image. Additionally or alternatively, the training image is converted to a pre-processed image by converting its pixels from a first color space (e.g., RGB) to a second color space (e.g., L*a*b). A first color channel (e.g., L channel) of the second color space can be extracted and used to train a machine learning model to detect artifact pixels.
[0027] In some cases, a set of image features can be added to the training images to train the machine learning model. For example, the set of image features can include a matrix of image gradient values. The matrix of image gradient values can identify, for each pixel in the training images, an image gradient value for the pixel. The image gradient value indicates whether the corresponding pixel corresponds to an edge of an image object. In some cases, the matrix of image gradient values is determined by applying a Laplacian of Gaussian (LoG) filter to the training images.
[0028] A machine learning model may include a set of convolutional layers. Each convolutional layer may be configured to include one or more filters (alternatively called "kernels"). For each pixel, a loss based on a comparison between the output of the set of convolutional layers and a value representing the label of the pixel may be backpropagated to modify the parameters of each filter in the set of convolutional layers.
[0029] In some cases, the machine learning model includes or corresponds to a machine learning model that includes a reduction pass and an expansion pass. For example, the machine learning model can include or be a U-Net machine learning model. The reduction pass can include a first set of processing blocks, each processing block corresponding to processing a training image at a corresponding image resolution. For example, the processing block can include applying two 3x3 convolutions (convolutions without padding) to the input (e.g., the training image), each convolution followed by a rectified linear unit (ReLU). Thus, the output of the processing block can include a feature map of the training image at the corresponding image resolution. Furthermore, the processing block includes a 2x2 max pooling operation with stride 2 for downsampling the feature map of the processing block to a subsequent processing block that can repeat the above steps at a lower image resolution. At each downsampling step, the number of feature channels can be doubled.
[0030] Following the reduction pass, the expansion pass includes a second set of processing blocks, each processing block corresponding to processing of the feature map output from the reduction path at a corresponding image resolution. For example, a processing block of the second set of processing blocks receives a feature map from a preceding processing block, applies a 2x2 convolution ("deconvolution") that halves the number of feature channels, and concatenates the feature map with the cropped feature map from the corresponding processing block of the reduction pass. The processing block can then apply two 3x3 convolutions to the concatenated feature map, each followed by a ReLU. The output of the processing block includes a feature map at the corresponding image resolution, which can be used as input for a subsequent processing block at a higher image resolution. The processing blocks can be applied until a final output is generated. The final output can include an image mask. The image mask can identify a set of artifact pixels, each of which is predicted to not accurately represent a point or region of at least a portion of the biological sample.
[0031] In some cases, the loss at each processing block of the second set of processing blocks is calculated and can be used to determine a total loss of the U-Net machine learning model. For example, the total loss can correspond to the sum of the losses generated from each of the second set of processing blocks. The total loss of the U-Net machine learning model can then be used to learn parameters of the U-Net machine learning model (e.g., parameters of one or more filters of a convolutional layer). In some cases, the loss of each processing block of the second set of processing blocks can be determined by applying a 1x1 convolutional layer to the feature maps output by the processing blocks to generate modified feature maps and determining the loss from the modified feature maps.
[0032] Additionally or alternatively, a set of machine learning models can be trained by training each machine learning model in the set at a particular image resolution. The set of machine learning models can be used to determine a target image resolution for detecting artifact pixels in slide images. In some cases, the output from the trained machine learning model at a lower image resolution is compared to a set of labels of training images at a higher image resolution, and a minimized loss is determined. If the minimized loss can indicate that the output can detect artifact pixels within an acceptable level of accuracy, the machine learning model can be deployed to detect artifact pixels in images at a lower image resolution. For example, if a machine learning model can be trained to detect artifact pixels within an acceptable level of accuracy at 5x, there is no need to deploy a machine learning model for image resolutions higher than 5x (e.g., 10x, 20x, 40x). In this way, the inference time for artifact detection can be reduced by a factor of 16 compared to another machine learning model that processes images at 20x the original image resolution.
[0033] C. Implementation of a machine learning model for detecting artifact pixels in images A third factor that may impair accurate artifact detection of machine learning models corresponds to existing training techniques that are unable to incorporate machine learning models for detecting artifacts into subsequent digital pathology analysis while keeping the increase in processing time and consumption of computing resources to a minimum. In particular, existing digital pathology analysis for detecting objects of interest (e.g., tissues, tumors, lymphocytes) in a given whole slide image may include dividing the whole slide image into a set of smaller image tiles. For each image tile of the set of image tiles, an analysis may be performed on the image tile to determine a classification of each image object appearing in the image tile. Thus, incorporating artifact detection into such digital pathology analysis may include, for each image tile of the set of image tiles of an image, (i) applying a machine learning model to detect artifact pixels in the image tile, (ii) excluding the detected artifact pixels from the image tile, and (iii) performing a digital pathology analysis (e.g., an image segmentation algorithm) to classify the image object displayed in the image tile excluding the artifact pixels. By applying multiple algorithms to each image tile, digital pathology of images with artifact pixel detection can suffer from increased processing time and consume additional computer resources, which can make the digital pathology analysis overall inefficient.
[0034] Furthermore, digital pathology analysis may require images scanned at high image resolution to achieve accurate results. For example, to detect tumor biomarkers in an image, the machine learning model used in digital pathology analysis may require scanning of the image at 20 or 40 times the original image resolution. Thus, tumor biomarker detection may already be resource intensive and time consuming. If the machine learning model for detecting artifact pixels requires the same image resolution, the processing time for detecting tumor biomarkers may further increase. Therefore, there is a need to incorporate machine learning models of artifact detection into digital pathology analysis in a way that keeps the increase in processing time and the consumption of computing resources to an acceptable level.
[0035] To address the above challenges, some embodiments include techniques for using different image resolutions to detect artifact pixels in an image. In some cases, the artifact pixels are predicted to represent a portion of an artifact. The artifact pixels can be detected during scanning of the slide and / or after generation of a digital image of the slide. In some embodiments, a machine learning model is trained to generate an image mask including a set of pixels of the image. The set of pixels of the image mask are indicative of artifact pixels, where the artifact pixels are predicted to not accurately represent at least a portion of a point or area of the biological sample. The machine learning model is further trained to process the image at a particular image resolution to generate the image mask. Thus, in some cases, an image having a higher image resolution is converted to a lower image resolution, and the machine learning model is applied to the converted image to generate the image mask. Additionally or alternatively, the machine learning model can be further trained to identify the amount of artifact pixels (e.g., the percentage of artifact pixels relative to the total number of pixels in the image). For example, the estimated amount may include a count of predicted artifact pixels, a cumulative area corresponding to multiple or all artifact pixels, a percentage of slide area or tissue area corresponding to the predicted artifact pixels, etc.
[0036] In some cases, the image is divided into a set of image tiles. A machine learning model can be applied to each image tile of the set of image tiles to generate an image mask. The image mask identifies a subset of the image tiles, and each image tile of the subset of image tiles can display one or more artifact pixels. The image mask can then be applied to the image to allow a user to deselect one or more image tiles of the subset of image tiles, and the deselected image tiles are excluded from further digital pathology analysis. Additionally or alternatively, the image mask can be applied to the image to select a subset of the image tiles of the image without user input and then excluded from further digital pathology analysis.
[0037] The trained machine learning model can be applied to images at a particular time to generate an image mask. For example, the machine learning model can be applied to an existing scanned image to generate an image mask. In another example, the machine learning model can be applied while the image is being captured by the scanning device. Additionally or alternatively, a preview image (e.g., a thumbnail image) can be initially captured by the scanning device. Image pre-processing algorithms, such as blur detection algorithms, can be applied to the preview image. If tissue regions are detected in the preview image, an initial image displaying the biological sample can be scanned. The initial image can display the biological sample at the target image resolution.
[0038] The machine learning model can be applied to the initial image to generate an image mask that identifies predicted artifact pixels and identifies the amount of artifact pixels present in the image. If the amount of artifact pixels exceeds an image area threshold, a warning can be generated indicating that the image is unlikely to produce accurate results when a subsequent digital pathology analysis is performed. In some examples, the artifact area threshold corresponds to a value that represents the relative size of the image portion within the image (e.g., 40%, 50%, 60%, 70%, 80%, 90%). If the amount of artifact pixels exceeds the artifact area threshold, it can be predicted that one or more artifacts will likely occupy a large portion of the image and thus cause poor performance of the subsequent digital pathology analysis (e.g., cell classification). At such time, the image can be rejected (e.g., automatically or in response to receiving a user input corresponding to an instruction to reject the image) and / or the biological sample can be rescanned to capture another image. In some cases, the image mask is overlaid on the image to show the image on a user interface with the predicted artifact pixels. Additionally or alternatively, the application of the machine learning model and generation of the alert may be performed for each image tile in the set of image tiles that form the image. In this manner, a decision to rescan the biological sample (for example) may be made before the entire image has been scanned, thus saving additional processing time and reducing the use of computing resources.
[0039] II. Generating Training Data for Training a Machine Learning Model to Detect Artifact Pixels To improve digital pathology to accurately detect diagnostic or prognostic biomarkers from slide images, quality control can be performed to detect and remove artifacts from slide images. Artifacts can include tissue folds, foreign bodies, blurred image areas, and any other image distortions. FIG. 1 shows an exemplary set of images 100 including artifact pixels. As shown in FIG. 1, exemplary image 102 shows a biological sample with acceptable focus quality, with cell phenotypic classification results overlaid as dots. Red dots correspond to positively stained cells. Black dots correspond to negatively stained cells. In contrast, exemplary image 104 shows the same image as image 102, but with a set of artifact pixels on the left side. The low number of red dots in exemplary image 104 indicates that the cell phenotypic classification model was not able to identify all the positively stained cells present in the biological sample. Due to the artifact pixels, the cell phenotypic classification model was unable to perform its corresponding digital pathology analysis. Although the example image shown in FIG. 1 clearly shows pixels that display blurred image portions, other images may include pixels that display blurred image portions with varying levels of blur.
[0040] To increase the efficiency of generation of training data from slide images (e.g., image 104 of FIG. 1), some embodiments include accelerating label collection for whole slide image quality control. In some cases, the proposed framework is applicable to label collection for other types of digital pathology analysis.
[0041] For artifact identification, there are two options: (1) pixel-by-pixel classification using image segmentation techniques where a classification label is assigned to each image pixel, and (2) tile-by-tile classification by image classification techniques where a classification label is assigned to each image tile. As used herein, an image tile refers to a portion of an image (e.g., a rectangular portion, a triangular portion) that includes a set of pixels. An image tile may represent a corresponding point or region of a biological sample, such as a cell and / or a biomarker. In some cases, a given slide image includes multiple image tiles, and the number of image tiles may range from tens or hundreds or thousands. The image tiles may be distributed such that the entire image or an area of interest within the image is covered by the image tiles.
[0042] To generate training data, pixel-by-pixel classification is used to identify whether each image pixel passes or fails quality control (e.g., the pixel is blurred). This allows for greater flexibility in terms of downstream analysis compared to tile-by-tile classification. This flexibility may be due to the pixel-level accuracy that the image segmentation algorithm provides. Additionally or alternatively, tile-by-tile classification may be used to generate pixel-by-pixel classification.
[0043] A. A framework for generating training data 2 shows a flow chart illustrating an exemplary process 200 for generating training data according to some embodiments. Images for generating training data may be accessed. In some cases, the images represent at least a portion of a biological sample. The images may be slide images representing tissue sections of a particular organ. In some examples, the biological sample has been stained using one or more types of assays (e.g., IHC, H&E).
[0044] In step 202, a specific quality control problem is determined. The specific quality control problem may include detection of artifact pixels. Additionally or alternatively, the quality control problem may include detection of other types of artifacts, such as foreign bodies, tissue folds, or any other image objects or distortions that result in an inaccurate representation of a portion of a biological sample. As step 204, it is determined whether there is an existing deep learning model or an existing labeled dataset for a similar purpose with the same image aspects. If such resources are available, the process 200 proceeds to step 206, where initial labels are generated by (1) performing inference on the target dataset using an existing model designed for a similar purpose, and (2) training a related model on the existing labeled dataset and then applying such model to the target dataset. If such resources (i.e., models or labeled datasets) are from different image aspects or image distributions, unsupervised domain adaptation can be utilized to adapt the existing model to the unlabeled target dataset.
[0045] If none of the aforementioned resources are available or valid, the process 200 proceeds to step 208, where it is determined whether the quality control problem can be reduced to an image processing problem. If so (the "Yes" path from step 208), an image preprocessing algorithm can be applied to predict labels (step 210). As a result, a set of initial labels can be generated. Each label can predict whether a corresponding pixel of the image accurately represents a corresponding point or region of a portion of the biological sample. In some cases, the image preprocessing algorithm includes image segmentation, morphological processing, image thresholding, image filtering, image contrast enhancement, blur detection, other image preprocessing algorithms, or combinations thereof. Additionally or alternatively, the image preprocessing algorithm can include using one or more other machine learning models to preprocess the image so that a set of initial labels can be generated.
[0046] For example, the image pre-processing algorithm can include blur detection to predict artifact pixels, which includes image filtering by image gradient calculation followed by thresholding to identify low gradient pixels. A set of pixels with low image gradient can be defined as a group of adjacent image pixels with relatively small intensity variations. In particular, pixels with low image gradient are considered to have uniform pixel intensity compared to pixels with relatively high image gradient. In another example, the image pre-processing algorithm can include tissue fold detection to predict tissue folds (i.e., tissue portions folding over other portions resulting in darker tissue regions). Tissue fold detection can include identifying a set of pixels with low image intensity that is significantly darker than other tissue regions. The set of pixels can be identified by first applying an image filter (in this case using a smoothing kernel such as a Gaussian filter) followed by intensity thresholding.
[0047] If image pre-processing algorithms are unavailable or invalid ("No" path from step 208), one or more weakly supervised image processing models can be used to generate initial labels (step 212). For example, a learning-based interactive segmentation model can be used with a graphical user interface, allowing a user to provide weak annotations such as mouse clicks to generate an object segmentation map.
[0048] Once the initial labels are generated in the presence of existing resources, they may be modified to correct errors (step 214). Although not shown, correction of the initial labels may also be performed after step 212. In some cases, a machine learning model is applied to the initial labels to determine that a subset of the initial labels are mislabeled. For example, the initial labels may indicate that corresponding pixels accurately represent corresponding points or regions of the biological sample, but the corresponding pixels contain one or more artifacts. By applying a machine learning model, this error may be addressed by modifying the initial labels.
[0049] Once the set of labels (including the modified labels) is obtained, training images including the set of labels can be generated. In step 216, the training images with the set of labels can be used to iteratively generate additional labels to generate additional training data (step 216). The additional training data can include additional training images, each of which includes a corresponding set of labels. For example, if there are pre-trained models available, preferentially from similar or the same image domain, transfer learning or few-shot learning can be applied to the training images to generate an initial model. The initial model can then be used to generate additional training data by making predictions on other unlabeled images and generating labels for the other unlabeled images. In another example, active learning can be applied to the training images to select a set of images from a plurality of images, and a subset of the images can be used to generate a corresponding set of labels. In yet another example, semi-supervised or fully supervised domain adaptation can be performed based on the training images to generate additional training data. Process 2 then ends.
[0050] Using the above framework, various types of artifacts that affect the accurate representation of a biological sample can be considered as labels. In some cases, additional types of artifacts are added to existing label types associated with the training data. For example, new types of artifacts can be merged with existing labels such that all artifacts have the same classification label "artifact tissue". In some embodiments, new types of artifacts are associated with a new label that is separate from any of the existing labels, such that the number of label types can be increased. For example, a new classification label for "tissue fold" can be generated.
[0051] In some cases, multiple labels are assigned to the same pixel to generate training data. In this case, each label of the multiple labels can predict whether the corresponding pixel displays at least a portion of an artifact associated with a particular artifact type (e.g., blur, foreign body, tissue fold). For example, tissue fold may be interwoven or otherwise correlated with blur artifacts. A pixel labeled as "tissue fold" may also display a blurred portion of the image. Thus, the pixel may be associated with two labels: (i) "tissue fold" and (ii) "blur artifact." Machine learning techniques, such as multi-label classification techniques, can be used to predict each image pixel as associated with one or more types of artifacts.
[0052] B. The process for generating labels for training images 3 shows a flow chart illustrating an example process 300 for using a machine learning model to generate training data according to some embodiments. The example process 3 for generating training data can include generating a label that predicts whether a corresponding pixel accurately represents a point or region of a portion of a biological sample. The example process can be incorporated into the example process presented in FIG.
[0053] In step 302, an image displaying at least a portion of a biological sample can be accessed. The image can be a slide image displaying a tissue section of a particular organ. In some examples, the biological sample has been stained using a staining protocol corresponding to a particular type of assay (e.g., IHC, H&E). For example, the image can display a biological sample stained using a staining protocol corresponding to a Ki67 IHC assay.
[0054] In step 304, image pre-processing can be applied to the image to generate a pre-processed image. The pre-processed image can include a plurality of labeled pixels. Each labeled pixel of the plurality of labeled pixels can be associated with a label that predicts whether the pixel accurately represents a corresponding point or region of at least a portion of the biological sample. Thus, the label can indicate whether the corresponding pixel originates from an artifact, non-artifact tissue, or other type of region.
[0055] In some cases, the image preprocessing algorithm includes image segmentation, morphological processing, image thresholding, image filtering, image contrast enhancement, blur detection, other image preprocessing algorithms, or combinations thereof. Image preprocessing can include analyzing image gradients of pixels across the image. For example, image preprocessing can be used to identify a set of pixels that are smooth (i.e., have no or very small local image intensity changes). Smooth pixels can be identified by calculating image gradients and applying a segmentation threshold. The segmentation threshold can represent a value that predicts whether a given pixel displays at least a portion of an edge that is shown in the image. The segmentation threshold can be a predetermined value. In some cases, the segmentation threshold is determined by performing Otsu's method or a balanced histogram thresholding method. Smooth pixels that have image gradients lower than the segmentation threshold can be identified as either blurred tissue or non-tissue regions with uniform image intensity. Additionally or alternatively, the image preprocessing algorithm can include using one or more other machine learning models to preprocess the image so that multiple labeled labels can be generated.
[0056] In step 306, a machine learning model may be applied to the preprocessed image to identify one or more labeled pixels from the plurality of labeled pixels. The label of each of the one or more labeled pixels may be predicted to be mislabeled by the image preprocessing algorithm. The error may be due to the image preprocessing algorithm not being effective enough to identify the correct label for all pixels. For example, a segmentation threshold applied as part of the image preprocessing algorithm may correctly identify artifacts in some images, but the same segmentation threshold may be too low for the rest of the image. In another example, a segmentation threshold that correctly identifies artifacts in some parts of an image may be too low for the rest of the same image. In both examples, some of the artifact pixels may be inappropriately labeled as tissue regions.
[0057] In step 308, for each of the one or more labeled pixels, the label may be modified. In some cases, the modification is performed by a user via a graphical user interface. Additionally or alternatively, the labels may be modified automatically using one or more executable instructions (e.g., if-else conditional statements).
[0058] At step 310, training images can be generated. The training images can include labeled pixels, such as labeled pixels having modified labels. In some cases, additional image features (e.g., image gradient values) can be associated with each labeled pixel to further facilitate training the machine learning model to identify artifact pixels.
[0059] At step 312, the training images are output. The training images can be used to generate additional training data. The additional training data can include additional training images, each of which includes a corresponding set of labels. Various types of machine learning techniques can be used to generate the additional training data. For example, the machine learning techniques can include, but are not limited to, using a machine learning model trained via active learning, transfer learning, few-shot learning, or domain adaptation. Thereafter, the process 300 ends.
[0060] C. Example training images with labels FIG. 4 illustrates an exemplary set of images 400 for which labels have been generated according to some embodiments. Each of the labels indicates whether the corresponding pixel accurately displays at least a portion of a biological sample. Image 402 illustrates a thumbnail image corresponding to a whole slide image displaying a tissue section. Image 404 illustrates a gradient-based map of the image generated by applying Laplacian filtering followed by Gaussian smoothing to the thumbnail image or an image corresponding to the whole slide image at another resolution. As shown in image 404, pixels with image gradients below a segmentation threshold can be identified as either blurred tissue or non-tissue regions with uniform image intensity.
[0061] Image 406 shows a tissue mask generated by applying a uniform filter and then thresholding the thumbnail image (or a corresponding image at another resolution). For example, a tissue detector can be applied to the image by smoothing the image with a uniform filter and applying a segmentation threshold on the intensity of the R, G, and B channels. As previously described, the segmentation threshold can represent a value that predicts whether a given pixel displays at least a portion of an edge shown in a given image. The segmentation threshold can be a predetermined value. In some cases, the segmentation threshold is determined by performing Otsu's method or a balanced histogram thresholding method. Pixels having intensity values higher than the edge detection threshold across all three channels can be identified as tissue pixels. The tissue mask can be used to generate an entire sliding blur mask (e.g., image 408) with three classifications including non-tissue, blurred tissue, and unblurred tissue.
[0062] Image 408 shows a pre-processed image (e.g., a blur map) generated by merging images 406 and 404. For example, the pre-processed image shown in image 408 shows predicted artifact pixels in a thumbnail image, with dark red colors identifying the predicted artifact pixels.
[0063] Image 410 shows a pre-processed image in which a set of image tiles can be identified. In some cases, image tiles with some artifact pixels are automatically selected. Pre-processed image 410 can correspond to image 408 and may include labels with various amounts of blur. Image tiles 412 and 414 represent image tiles selected from pre-processed image 410. In particular, image tile 412 displays a region of a biological sample stained using an ER-Dabsyl IHC assay (ER: estrogen receptor). Image tile 414 identifies an initial label within the region. The initial label can include multiple classifications such as blurred tissue, non-tissue, and non-blurred tissue.
[0064] Image 416 shows a screenshot of an interactive graphical user interface showing image tiles, with which a user can interact (e.g., mouse click) to modify the initial labels. In some cases, the modification of the initial labels is performed by applying a machine learning model to the preprocessed image 410 or a selected image tile from 410. The machine learning model can modify the entire blur mask with high accuracy using a limited number of annotations. The machine learning model can be a separate process (not shown) or can be integrated into the graphical user interface. The application of the machine learning model can be performed using a CPU or by leveraging highly parallelized computation using a GPU, thus ensuring efficient label correction.
[0065] D. Determining the blur level for accurate label determination Subjectively determining a particular threshold for detecting artifact pixels may inevitably lead to discrepancies between experts' perceptions of blur and blur levels. Such discrepancies may result in significant degradation of the performance of digital pathology algorithms. FIG. 5 shows an example image including image portions each exhibiting different levels of blur. In particular, a pathologist may claim that image 500 is analyzable for more than 70% of the image. However, in practice, it may be shown that a large portion of image 500 is blurred, which may be problematic for classification models. For example, image tile 502 may be considered by a particular expert to be not blurred, but is not in focus enough for a classification model to accurately detect biomarkers.
[0066] To improve the consistency of identifying artifact pixels in an image, the performance change of a classification model (e.g., cell classification) can be quantitatively evaluated at various blur levels. A blur threshold can be selected that corresponds to a blur level that is predicted to result in a performance degradation of the classification model beyond an acceptable threshold. The blur threshold can be used to indicate any tiles in the image that are considered to be more blurred (e.g., image tiles 504). In some cases, any pixels in an image tile are labeled as blurred tissue if these pixels are located in an image portion that corresponds to a tissue region (e.g., in a tissue region in tissue mask 406) and the respective image gradient is lower than the blur threshold.
[0067] In some cases, the blur threshold can be determined by generating a set of sample images, where each sample image in the set of sample images can be generated by applying Gaussian filtering at a particular sigma value to display one or more regions of the sample at various levels of blur.
[0068] Additionally or alternatively, the volume scan function of the digital pathology scanner can be used to set the blur threshold. For example, a z-stack of the digital pathology scanner and / or microscope can be used to scan the z-axis of the slide to obtain a set of scans with increasing distances from the nominal focal plane. The set of scans can correspond to increasing levels of blur. An exemplary process for using the volume scan function to determine the blur threshold can be as follows: First, a volume scan image can be generated by rescanning a training image with labels in a "volume scan" mode of the scanning device for a fixed assay and a fixed downstream digital pathology analysis (e.g., cell classification model). In some cases, the scan setting for the volume scan includes scanning the training image using a non-nominal focal scan plane with a fixed interval (e.g., 1 micron). Based on the volume scan image, a set of pixels for which the accuracy of the digital pathology analysis becomes insufficient can be detected. In some cases, a range of image gradients in the identified set of pixels can be calculated. The maximum image gradient within the range of image gradients can be set as the blur threshold. Pixels with image gradients exceeding a blur threshold can be predicted as pixels that will cause more than an acceptable level of accuracy degradation in subsequent digital pathology analysis.
[0069] E. Identifying tissue fold artifacts to generate training data Tissue folds typically occur during tissue processing (e.g., tissue slide preparation) where one or more portions of a tissue section do not adhere firmly onto the glass slide and flip over onto another portion of the tissue section. FIG. 6 shows an exemplary set of images 600 including one or more tissue folds in a corresponding biological sample. As shown in FIG. 6, tissue folds can have a variety of appearances. For example, a first image 602 shows a tissue fold that is much darker in intensity than the surrounding non-tissue fold areas. A second image 604 shows a tissue fold that is brighter in intensity while still allowing significant visibility of cells in the underlying tissue layer. A third image 606 shows a tissue fold area with blurred areas. The blurred areas can be caused by the thickness of the tissue fold exceeding the scanner's depth of field.
[0070] Different processes may be used to generate ground truth images including tissue fold regions. FIG. 7 shows an exemplary schematic diagram 700 for generating training data for tissue fold regions according to some embodiments. The training data can then be used to generate a binary tissue fold mask. In FIG. 7, there was no existing machine learning model, no existing ground truth, and no effective image processing technique for generating the initial ground truth. Thus, referring again to FIG. 2, the answers of steps 204 and 208 were both identified as "no". As a result, step 212 was performed to generate training data for tissue fold regions, where an interactive GUI was utilized to generate ground truth images. The generation of training data for tissue fold regions can include using an interactive segmentation GUI to generate a binary tissue fold mask, where the two classifications are tissue fold and non-tissue fold.
[0071] In some cases, the tissue fold mask 702 is generated based on one of three approaches: (1) blurred ground truth (in the case of FOV 704 selected from blurred ground truth) (block 706); (2) regions identified by an image processing algorithm (e.g., identifying FOVs with tissue folds from additional Mosaic WSI (block 708)); and (3) regions selected by an interactive GUI (block 710). In some cases, each of the three approaches is performed in turn to generate the tissue fold mask. For example, it can be determined whether the tissue fold mask generated based on the blurred ground truth is accurate (e.g., based on visual inspection). If not, the regions generated by the image processing algorithm can be used. If the regions generated by the image processing algorithm do not result in an accurate tissue fold mask, the regions manually selected by the interactive GUI can be used to generate the tissue fold mask. (block 710).
[0072] In some cases, the interactive GUI includes one or more machine learning models to facilitate the selection of tissue fold regions. For example, the interactive GUI can include: (i) a first GUI component that allows manual description to select image regions and visualizes the selected regions for iterative manual correction, and (ii) a second GUI component that allows user input such as writing and mouse clicks to guide the automatic identification of target regions. For the interactive GUI, an image processing method can be designed or a machine learning model can be trained to generate a segmented mask in response to user input. For example, a machine learning model can be trained with simulated user clicks in the target image region as well as the original image as model input and output a segmentation mask. In practice, a deep learning interactive GUI can learn how to identify target regions with user inputs that are usually only a few pixels or a portion of the target image region. Furthermore, a user can iteratively modify existing inputs or add new inputs to modify the segmentation mask until the mask is accurate and can be used as ground truth for training the machine learning model.
[0073] A binary tissue fold mask can be combined with a corresponding tissue mask to generate a three-class tissue fold mask. Figure 8 includes a set of exemplary three-class tissue fold masks 800 according to some embodiments. A first three-class tissue fold mask 804 corresponds to a first slide image 802 and a second three-class tissue fold mask 808 corresponds to a second slide image 806. Each of the three-class tissue fold masks 804 and 808 can include, for each pixel, a first classification for non-tissue regions, a second classification for non-tissue fold tissue regions, and a third classification for tissue fold regions.
[0074] F. Integrating different types of artifacts into classification labels To train the machine learning model to detect more than one type of artifact, the artifact regions detected in the training images can be differentiated between blurred ground training labels and tissue fold ground labels. For example, four types of classifications can be integrated into the segmentation mask, which can include: (1) non-tissue regions, (2) blurred non-tissue fold regions, (3) non-blurred tissue fold regions, and (4) analyzable tissue regions.
[0075] However, the four-class label configuration assumes that blurred tissue regions and tissue fold regions are mutually exclusive, which is not necessarily the case. For example, as shown in images 602 and 606 of FIG. 6, tissue fold regions are often accompanied by blurred regions. For example, FIG. 9 shows an example image 900 (e.g., FOV) including a tissue fold region, where the tissue fold region displays both non-blurred and blurred regions. Thus, assigning the blurred pixels of the tissue fold region in FIG. 9 as either a "blurred" class or a "tissue fold" class creates confusion when training a corresponding machine learning model.
[0076] In another example, FIG. 10 shows an example set of images 1000 displaying various artifact regions. For example, FOV 1002 displays blurred regions interwoven with tissue fold regions. A tissue fold binary mask 1004 can distinguish tissue folds from non-tissue fold regions. In contrast to the tissue fold binary mask 1004, a blurred ground truth mask 1006 that segments the image into four classifications displays a confusing pattern of classified regions. For example, the presence of interwoven blurred regions can split the tissue fold region into multiple small tissue fold sub-regions, which can be unclear in meaning and significantly increase the difficulty for a machine learning model to learn meaningful features for tissue fold classes.
[0077] To address the inaccurate classification of tissue fold regions, two types of classification strategies can be implemented. The first strategy can include combining tissue fold regions and blurred tissue regions into a single class (e.g., non-analyzed region class). The blurred tissue regions and tissue fold regions are classified as a "non-analyzed tissue" class. In practice, a three-class segmentation can be output that classifies each pixel into one of the following three classes: non-tissue, analyzable tissue, and non-analyzed tissue. For example, FIG. 11 illustrates an exemplary artifact mask 1100 generated using a composite artifact classification technique according to some embodiments. FIG. 12 illustrates a further artifact mask 1200 using a composite artifact classification technique according to some embodiments. In FIG. 12, three-class ground truth masks 1204 and 1208 segment the regions of a biological sample shown in the FOV (raw RGB) stained with TAMRA-ER 1202 and QM-Dabsyl-ER / TAMRA-PR 1206. For FOV 1202, the non-analysis region was mostly unblurred. For FOV 1206, the non-analysis region includes unblurred tissue fold regions and blurred regions. Thus, Figures 11 and 12 classify image regions into one of three classes: (i) non-tissue, (ii) analyzable tissue, and (iii) non-analyzed tissue.
[0078] The second classification strategy can include associating pixels with two or more classification labels. Multi-label segmentation can facilitate classifying each pixel as one or more of the following four classes: non-tissue, analyzable tissue, non-analyzable tissue, and tissue fold. To generate multiple classifications, a binary value (either positive or negative for that classification) can be assigned to each classification at each pixel location. For example, FIG. 13 illustrates a slide image 1300 in which pixels are associated with two or more classification labels according to some embodiments. In FIG. 13, slide image 1300 illustrates pixels 1302 and 1306 associated with a single label. Additionally, slide image 1300 illustrates pixel 1304 associated with two labels (e.g., blurred tissue label, tissue fold label). As illustrated in FIG. 13, a region of a biological sample illustrated in slide image 1300 can be associated with multiple different labels. Thus, the 4x1 array shown in Figure 13 identifies a label for each pixel, where a 0 indicates a negative presence for the corresponding region (e.g., this pixel does not belong to this class) and a 1 indicates a positive presence for the corresponding region (e.g., this pixel belongs to this class).
[0079] FIG. 14 illustrates a process 1400 for identifying classification labels for pixels associated with both blurred and tissue fold regions according to some embodiments. In step 1402, pixels associated with multiple classifications (e.g., non-analyzed and tissue fold) may be identified. In step 1404, the pixel may be associated with a binary value for each classification in a set of classifications. The set of classifications may include: (a) non-tissue, (b) analyzable tissue, (c) blurred tissue, and (d) tissue fold. The binary value may indicate the presence of an object associated with the corresponding classification (e.g., tissue fold). For example, pixel 1304 includes a binary value of "1" for both blurred tissue and tissue fold, and a binary value of "0" for non-tissue and analyzable tissue. A binary value of "1" may indicate that pixel 1304 displays both blurred tissue and tissue fold. In some cases, the "blurred tissue" class may be replaced with a non-analyzed class (either blurred or tissue fold). In some cases, one of the multiple classifications is selected to represent the pixel. In optional step 1406, the set of classifications can be ranked based on their respective predicted probability values at the pixel location. In particular, a probability of how likely the pixel is to belong to each classification of the set of classifications can be generated (e.g., using a machine learning model). For example, a three-class segmentation model generates three numbers for each pixel, such as [0.1, 0.2, 0.7], which are the probabilities that this pixel belongs to each class. In this example, the set of classifications can be ranked according to probability, with class 3 considered to be ranked with the highest value. In practice, the highest probability corresponds to the class to which the pixel is most likely to belong. In optional step 1408, the classification with the highest probability value can be selected as the final predicted label for the pixel.
[0080] To generate labeled images for training a machine learning model, no additional processing for ground truth masks needs to be performed. Rather, two sets of ground truth masks can be used, including a first set corresponding to three-class blur masks (e.g., non-tissue, analyzable tissue, blurred tissue) and a second set corresponding to tissue fold regions within tissue regions (e.g., binary tissue fold masks). In some cases, labeling of each pixel can be performed using a 4×1 array during model training.
[0081] The above-mentioned machine learning techniques can facilitate accurate classification of regions within slide images. For example, FIG. 15 illustrates a comparison 1500 between predicted classifications with ground truth masks according to some embodiments. For example, a first set of images 1502 illustrates a comparison between a predicted mask and a corresponding ground truth mask for an image stained using a single IHC that includes the estrogen receptor (ER). A second set of images 1504 illustrates a comparison between a predicted mask and a corresponding ground truth mask for an image stained using a single IHC that includes cytokeratin 7 (CK7). A third set of images 1506 illustrates a comparison between a predicted mask and a corresponding ground truth mask for an image stained using a dual IHC that includes the estrogen receptor and the progesterone receptor (ER / PR). Based on the comparison, it can be seen that the predicted segmented masks are qualitatively similar to the corresponding ground truth masks.
[0082] Further, FIG. 16 illustrates predicted regions in a slide image 1600 from different types of IHC assays according to some embodiments. For example, a first image 1602 illustrates an image tile stained using a dual IHC assay including LIV / HER2 and a corresponding predicted segmentation mask including three classifications (e.g., unblurred tissue, blurred tissue, non-tissue). A second image 1604 illustrates a second image tile stained using a triple IHC assay including ER / Ki67 / PR and a corresponding predicted segmentation mask including three classifications. A third image 1606 illustrates a third image tile stained using a triple IHC assay including CD8 / BCL2 / CD3 and a corresponding predicted segmentation mask including three classifications. Qualitative evaluation of the predicted segmentation masks illustrates accurate classification of unblurred tissue, blurred tissue, and non-tissue.
[0083] III. Training a Machine Learning Model to Accurately Detect Artifact Pixels As mentioned above, since images can be stained using various types of IHC assays, training machine learning models to accurately detect artifact pixels can be complicated.For example, fluorescence-based IHC assays can use multispectral imaging to separate several different fluorescence spectra, which allows accurate identification of multiple antigens on the same tissue section.However, these multiplex IHC assays can produce more complex staining patterns than single IHC assays (e.g., IHC assays that target a single type of antigen).
[0084] 17 shows an exemplary set of images 1700, where each image is stained using a staining protocol corresponding to a particular type of IHC assay. Image 1702 shows a biological sample stained with hematoxylin only. Image 1704 shows a biological sample stained using a single IHC assay. In particular, image 1704 shows the nuclear staining pattern of a biological sample with Dabsyl stained estrogen receptors, where Dabsyl was used as the chromogen, resulting in a yellow stain. Identifying artifacts (e.g., artifact pixels) in images 1702 and 1704 can be relatively straightforward.
[0085] The artifact detection process becomes much more difficult in images stained using a staining protocol corresponding to a multiplex IHC assay. For example, image 1706 shows a biological sample stained using a dual IHC assay. In particular, image 1706 shows the nuclear staining pattern of a biological sample stained with Tamra to identify estrogen receptors (i.e., ER) and Dabsyl to identify progesterone receptors (i.e., PR). In image 1706, Tamra can represent purple staining and Dabsyl can represent yellow staining. However, image 1706 also shows a blend of both stains showing different hues that may be caused by various factors including staining protocols, chromogen interference, and relative expression levels of biomarkers. In another example, image 1708 shows a biological sample stained using another type of dual IHC assay. In particular, image 1708 shows a biological sample stained using Tamra-PDL1 (programmed death ligand 1) and Daybsyl-CK7 (cytokeratin 7), where the tissue areas stained with PDL1 show primarily membranous staining and the tissue areas stained with CK7 show primarily cytoplasmic staining. However, image 1708 also shows tissue areas where both stains overlap. Thus, it can be difficult to detect artifacts from these types of images.
[0086] Thus, a machine learning model can be trained to detect artifact pixels in images having various staining patterns. The technique can include accessing training images displaying at least a portion of a biological sample. The training images can include a plurality of labeled pixels, each pixel having a label associated therewith. The label predicts whether the pixel is an artifact pixel. The training images can be used to train the machine learning model. The machine learning model can include a set of convolutional layers, and a first loss calculated for a first convolutional layer and a second loss calculated for a second convolutional layer can be used to train the machine learning model to detect artifact pixels at a target image resolution.
[0087] A. Architecture for training a machine learning model for artifact pixel detection To improve the ability of the machine learning model to effectively detect artifact pixels across various image resolutions, a teacher can be added in the training stage of the machine learning model trained at each of a set of image resolutions. Figure 18 shows a schematic diagram illustrating an example architecture 1800 used to train a machine learning model to detect artifacts in images according to some embodiments. In Figure 18, an encoder-decoder model architecture for image segmentation is shown, where features from each of multiple image resolutions in the decoder path can be utilized for pixel-by-pixel classification.
[0088] In some cases, the encoder-decoder model architecture includes U-Net. The machine learning model includes a U-Net machine learning model trained to detect artifact pixels in an image. The U-Net machine learning model can include a reduction pass and an expansion pass. The reduction pass can include a first set of processing blocks, each processing block corresponding to processing a training image at a corresponding image resolution. For example, the processing block can include applying two 3x3 convolutions (convolutions without padding) to the input (e.g., the training image), each convolution followed by a rectified linear unit (ReLU). Thus, the output of the processing block can include a feature map of the training image at the corresponding image resolution. Furthermore, the processing block includes a 2x2 max pooling operation with stride 2 for downsampling the feature map of the processing block to a subsequent processing block that can repeat the above steps at a lower image resolution. At each downsampling step, the number of feature channels can be doubled.
[0089] Following the reduction pass, the expansion pass includes a second set of processing blocks, each processing block corresponding to processing of the feature map output from the reduction path at a corresponding image resolution. For example, a processing block of the second set of processing blocks receives a feature map from a preceding processing block, applies a 2x2 convolution ("deconvolution") that halves the number of feature channels, and concatenates the feature map with the cropped feature map from the corresponding processing block of the reduction pass. The processing block can then apply two 3x3 convolutions to the concatenated feature map, each followed by an (optional) batch normalization layer and ReLU. The output of the processing block includes a feature map at the corresponding image resolution, which can be used as input for a subsequent processing block at a higher image resolution. The processing blocks can be applied until a final output is generated. The final output can include an image mask. The image mask can identify a set of artifact pixels, each of which is predicted to not accurately represent a point or region of at least a portion of the biological sample.
[0090] In some cases, the loss at each processing block or at some processing blocks of the second set of processing blocks is calculated and can be used to determine the total loss of the U-Net machine learning model. The total loss can be a calculation based on the losses calculated from the selected processing blocks. For example, the total loss can be determined based on the sum or weighted sum of the losses generated from each of the second set of processing blocks. In a second example, the total loss can be determined based on the average or weighted average between the losses calculated for each processing block. The total loss of the U-Net machine learning model can then be used to learn parameters of the U-Net machine learning model (e.g., parameters of one or more filters of a convolutional layer). Using the total loss of the U-Net machine learning model enables detection of artifact pixels across a range of image resolutions.
[0091] In some cases, the loss of each processing block of the second set of processing blocks can be determined by applying a 1x1 convolutional layer to the feature maps output by the processing block to generate one or more modified feature maps and determining the loss from the one or more modified feature maps. In particular, 1x1 convolutions can be applied such that the number of modified feature maps corresponds to the number of class labels (e.g., three modified feature maps for three label types). In some cases, the modified feature maps are upsampled to the same resolution as the output of the machine learning model (e.g., image masks). Additionally or alternatively, the image masks (having the same size as the training images) can be downsampled to the same resolution as the modified feature maps.
[0092] B. Integrating global information to detect large-scale artifacts in images In some cases, the second machine learning model is trained to detect artifact pixels in the image that are predicted to correspond to larger artifacts in the image. The use of the additional machine learning model can circumvent limitations on input tile size due to limitations in computing resources (e.g., hardware memory). To this end, parameters of the additional machine learning model can be learned based not only on features of a particular image tile of an image, but also on features of adjacent tiles of the same image, to incorporate information from adjacent image regions of each image tile. Thus, the additional machine learning model can be trained using information corresponding to dependencies between the target image tile and its adjacent image tiles. In some cases, the additional machine learning model includes a recurrent neural network (e.g., a gated recurrent neural network) and a long-short-term memory.
[0093] The second machine learning model can be trained to (i) replace a machine learning model with a set of convolutional layers (e.g., a convolutional neural network), (ii) be used before or after the execution of the machine learning model, and / or (iii) be integrated into the machine learning model.
[0094] A recurrent neural network includes a chain of recurrent neural network modules ("cells"). Specifically, the operation of a recurrent neural network involves iterating through a single cell indexed by its location in the image tile (t) of interest. To provide its recurrent behavior, a recurrent neural network iterates through a hidden state s, which is provided as input to the next iteration of the network. t The hidden state may be a vector or a matrix that represents information from neighboring image tiles. As referred to herein, the variable s t and h t are used interchangeably to represent the hidden state of a recurrent neural network. A recurrent neural network computes a feature representation of a target image tile x t and the hidden state value s determined using the set of input features of the neighboring image tiles. t-1 In some cases, we receive a feature representation of the target image tile x t is generated using a machine learning model with a pair of convolutional layers. The following equation expresses the hidden state s t This provides how is determined. s t =φ(Ux t +Ws t-1 ) where U and W are the x t and s t-1 where φ is a nonlinear function such as tanh or ReLU.
[0095] As shown, Ux t and Ws t-1 s generated based on application of t The values can be used as hidden state values for the next iteration of the recurrent neural network that processes features corresponding to subsequent image tiles.
[0096] The output of the recurrent neural network is expressed as follows: o t= softmax(Vs t ) where V is the hidden state value s t is the weighting value applied to
[0097] Therefore, the hidden state s t can be called the memory of the network. In other words, the hidden state s t Step o depends on information related to the input and / or output that is used or otherwise derived from one or more previous image tiles. t The output in is a set of values used to identify artifact pixels that are calculated based at least in part on the memory at the target image tile location t.
[0098] C. A process for training a machine learning model to accurately detect artifact pixels FIG. 19 shows a flow chart illustrating an example process 1900 for training a machine learning model to accurately detect artifact pixels according to some embodiments. In step 1902, a training image displaying at least a portion of a biological sample can be accessed. The training image includes a plurality of labeled pixels, each labeled pixel of the plurality of labeled pixels having a label associated therewith. The label predicts whether a corresponding pixel accurately displays a corresponding point or region of at least a portion of the biological sample. For example, a pixel displaying an out-of-focus region of the biological sample can be labeled as not accurately displaying a corresponding region (e.g., a portion of a tissue section).
[0099] In some cases, the training image is converted to a grayscale image. The grayscale image is used to train machine learning to detect artifact pixels. Additionally or alternatively, the training image is converted to a preprocessed image by converting its pixels from a first color space (e.g., RGB) to a second color space (e.g., L*a*b). A first color channel (e.g., L channel) of the second color space can be extracted and used to train the machine learning model to detect artifact pixels. By converting to a different color space, uninformative color information can be eliminated from artifact detection modeling, and the machine learning model is run to learn discriminatory image features that are unrelated to complex color changes and uneven staining patterns that are rarely related to artifacts.
[0100] In step 1904, a machine learning model including a set of convolutional layers can be accessed. For example, the machine learning model is a U-Net architecture. In some cases, the machine learning model is configured to apply each convolutional layer of the set of convolutional layers to a feature map representing the input image.
[0101] In step 1906, the machine learning model is trained to detect one or more artifact pixels in the image at the target image resolution. The artifact pixels of the one or more artifact pixels are predicted to not accurately represent a point or region of at least a portion of the biological sample. For example, the artifact label can predict the presence of an artifact (e.g., blur, tissue fold, foreign object) that may result in a pixel not accurately representing a corresponding region of the biological sample.
[0102] In some cases, a set of image features is used with the training images to train the machine learning model. For example, the set of image features can include a matrix of image gradient values. The matrix of image gradient values can identify, for each pixel in the training images, an image gradient value for the pixel. The image gradient value indicates whether the corresponding pixel corresponds to an edge of an image object. In some cases, the matrix of image gradient values is determined by applying a Laplacian of Gaussian (LoG) filter to the training images.
[0103] Training the machine learning model may include learning parameters of the machine learning model based on the loss value calculated for each pixel. For each labeled pixel of the plurality of labeled pixels of the training image, the training may include determining a first loss for the labeled pixel in the first image resolution by applying a first convolutional layer of the set of convolutional layers to a first feature map representing the training image in the first image resolution. A second loss for the labeled pixel in the second image resolution may then be determined by applying a second convolutional layer of the set of convolutional layers to a second feature map representing the training image in the second image resolution. In some cases, the second image resolution has a higher image resolution relative to the first image resolution.
[0104] The training can further include determining a total loss for the labeled pixels based on the first loss and the second loss. The total loss can be used to determine that the machine learning model has been trained to detect the one or more artifact pixels at the target image resolution.
[0105] In step 1908, the trained machine learning model is output. The trained machine learning model can be used by another system to detect artifacts in other images having different staining patterns. Thereafter, process 1900 ends.
[0106] D. Training a Machine Learning Model to Predict Two or More Types of Artifacts In some cases, the machine learning model is trained using a three-class tissue fold mask (e.g., three-class tissue fold mask 804 of FIG. 8) to identify more than one type of artifact for at least a portion of a given slide image (e.g., FOV). For example, the machine learning model can be trained to detect a first set of pixels corresponding to blurred regions and a second set of pixels corresponding to tissue folds. To train a multi-classification model, the pixels of each training image can be labeled as one or more of "tissue region," "non-analysis region" corresponding to blurred regions, and "non-analysis tissue" corresponding to tissue fold regions within the tissue region.
[0107] A multi-classification model can be initially trained to detect and segment artifact regions. FIG. 20 shows a flow chart illustrating a process 2000 for training a machine learning model for detecting artifact regions in slide images according to some embodiments. In FIG. 20, a first training stage can be performed to train a machine learning model to detect artifact regions displayed in slide images, and a second training stage can be performed to perform an evaluation of the performance of the machine learning model. For the first training stage, a set of slides can be selected to generate a ground truth mask (step 2002). In step 2004, a first set of training images can be generated. The first set of training images can include a segmentation mask that identifies two or more types of artifacts. The process for generating the first set of training images can include the process 700 of FIG. 700. In step 2006, the first set of training images can be divided into a model training dataset, a validation dataset, and a test dataset. In step 2008, the machine learning model can be trained using the first set of training images. Training the machine learning model using the first set of training images is further described in process 1900 of Figure 19. In step 2010, the segmentation performance of the machine learning model can be tested based on performance scores such as precision and recall.
[0108] An additional set of slides may be selected for the second training stage (step 2012). In some cases, the additional set of slides includes slides from unseen tissue types, biomarkers, and chromogens. The additional set of slides may differ from those used in the first training stage because the objective is to have a separate set of slides to pressure test the model performance to assess generalizability to unseen images, chromogens (combinations), biomarkers, and tissue types. In some cases, an FOV is selected from the additional set of slides. A second set of training images may then be generated based on the additional set of slides. In step 2014, a label may be assigned to the pixels of each training image in the second set of training images. The labels may be assigned by receiving two types of readouts from an annotator. The first type of readout may include whether tissue folds are present within the FOV, and the second type of readout may include the percentage of non-analyzed tissue within the tissue region within each selected FOV. In step 2016, the machine learning model can be trained and tested using a second set of training images for an independent test of model generalizability. In some cases, the annotation percentages are compared to the model predictions as a proxy for model generalizability. As a result, the machine learning model can be trained and tested to detect artifact regions in other slide images.
[0109] IV. Implementing a Machine Learning Model to Detect Artifact Pixels in Images Due to the large size of whole slide images, automated digital pathology analysis needs to be performed as efficiently as possible without sacrificing accuracy. Typically, digital pathology analysis (e.g., cell classification model) can include generating a set of image tiles from a whole slide image, where an image tile can represent a portion of an image having a particular size and dimension (e.g., 20x20 pixels). Cell classification (for example) can then be performed on each image tile to generate a corresponding predicted result, which can then be reassembled to the whole slide image resolution.
[0110] Therefore, applying quality control to digital pathology analysis can double the processing time. However, it is not necessary to perform slide quality control at the same resolution as the primary digital pathology analysis, which is typically 20x or 40x resolution. This is because many types of artifacts can be identified at lower image resolutions. Furthermore, large artifacts, such as large tissue folds, cannot fit into an image tile at high resolution. Thus, in some cases, performing quality control at high image resolutions produces inconsistent results.
[0111] To increase efficiency in implementing artifact detection in digital pathology analysis, some embodiments include using different image resolutions to detect artifact pixels in images. A set of training images can be acquired. For each training image, a label corresponding to each pixel can be collected at a high image resolution (e.g., 40x, 20x, 10x). An artifact detection machine learning model (e.g., the U-Net machine learning model of FIG. 18) is trained using the set of training images. The machine learning model is further trained and tested using images with a lower image resolution to determine a target image resolution. At the target image resolution, the machine learning model can maintain the detection accuracy of artifact pixels while increasing efficiency. For example, if the machine learning model can be trained to detect artifact pixels within an acceptable level of accuracy at 5x, the target resolution can be determined as 5x, and there is no need to apply the machine learning model to detect artifact pixels at higher image resolutions (e.g., 10x, 20x). In this way, inference time can be reduced by 16 times compared to another machine learning model that detects artifact pixels at (e.g.) 20x image resolution.
[0112] A. A process for integrating artifact detection into digital pathology analysis 21 shows a flowchart illustrating an example process 2100 for using a trained machine learning model to accurately detect artifact pixels according to some embodiments. In step 2102, an image displaying at least a portion of a biological sample is accessed. For example, the image may be a slide image displaying a tissue section of a particular organ. The biological sample may include a tissue section stained using a staining protocol of a particular type of IHC assay. In some cases, the image is at a first image resolution (e.g., 40x).
[0113] In step 2104, a machine learning model trained to detect artifact pixels in an image at a second image resolution is accessed. The machine learning model may be a machine learning model having a set of convolutional layers (e.g., U-Net). In some cases, the first image resolution of the image (e.g., 40x) has a higher image resolution relative to the second image resolution (e.g., 5x).
[0114] In step 2106, the image is transformed to generate a transformed image that displays at least a portion of the biological sample at a second image resolution. For example, one or more image resolution conversion algorithms including mipmapping, nearest neighbor interpolation, and Fourier transform can be used to change the image resolution and generate the transformed image.
[0115] In step 2106, the machine learning model is applied to the transformed image to identify one or more artifact pixels from the transformed image, where the artifact pixels of the one or more artifact pixels are predicted to not accurately represent at least a portion of a point or region of the biological sample. For example, the artifact pixel may be predicted to represent a portion of a blurred portion of a given image, or to represent a portion of a foreign object shown in the image.
[0116] In step 2108, an output is generated that includes one or more artifact pixels. In some cases, the output includes an artifact mask that identifies the artifact pixels with pixel-level accuracy. The artifact mask can be used to identify portions of the image that correspond to various classes (e.g., unblurred tissue, blurred tissue, non-tissue). Additionally or alternatively, the output can indicate the amount of artifact pixels (e.g., the percentage of artifact pixels relative to the total number of pixels in the image). For example, the estimated amount may include a predicted artifact pixel count, a cumulative area corresponding to multiple or all artifact pixels, a percentage of slide area or tissue area corresponding to the predicted artifact pixels, etc. Process 2100 then ends.
[0117] In some cases, the predicted artifacts in the image (e.g., artifacts represented by one or more artifact pixels) are classified into one of the following classifications: (a) a first artifact classification, where the artifacts occur only during scanning of the slide, and (b) a second artifact classification, where the artifacts occur at all times (e.g., experiment, staining). If the predicted artifacts correspond to the first artifact classification, the digital pathology analysis can proceed without further quality control operations. If the predicted artifacts correspond to the second artifact classification, a warning is generated to the user prompting them to reject the image and / or to rescan the biological sample to generate another image representing the biological sample. In some cases, the graphical user interface is configured to allow the user to reject the image. Additionally or alternatively, a quality control algorithm can be designed for each type of predicted artifact. The quality control algorithm for the predicted type of artifact can output a result that triggers rejection of the image and / or rescanning of the biological sample.
[0118] B. Configuration for quality control It is not uncommon that some artifacts (e.g., blurred image areas) may be present in the slide images. From a user experience perspective, scanned slides with a large amount of artifacts introduced during scanning are undesirable. Furthermore, considering the large size of histology slides, digitizing all slides with obvious quality issues may increase storage space and scanning time. This issue may be more pronounced in large projects when the scanning speed is not optimal. Therefore, artifact detection at the scanning stage can be considered as an alternative to performing artifact detection after slide digitization.
[0119] 1. Slide Image Preprocessing In some cases, image pre-processing is applied to the image before the machine learning model is applied to the image to detect artifact pixels. For example, a preview image (e.g., a thumbnail image) can be first captured by scanning a slide displaying the biological sample with a scanning device. Image pre-processing algorithms, such as blur detection algorithms, can be applied to the preview image. If tissue regions are detected in the preview image, an initial image displaying the biological sample can be scanned. The initial image can display the biological sample at the target image resolution.
[0120] As an illustrative example, a slide of a biological specimen can be scanned at thumbnail resolution (e.g., 1.25x) or another lower resolution to generate a preview image. The lower resolution of the preview image allows the scan time to be within a predefined time threshold. The predefined time threshold can be selected from various time values, such as 10 seconds, 15 seconds, 20 seconds, or any larger value. Image preprocessing can be applied to the preview image to identify image portions predicted to display one or more tissue regions of the biological specimen. If no tissue regions are identified, the quality control process ends. If one or more tissue regions are identified, a machine learning model can be applied to the image captured at a relatively higher resolution (e.g., 4x).
[0121] 2. Artifact detection during image scanning Scanning systems for digital pathology typically include line scanners and tile-based area scanners. In a line scanner system, a line sensor can perform image acquisition one line / stripe at a time, where the line may be one pixel wide and has a length specified by the design of the sensor in the system. After the scan is completed for the entire slide, the image data acquired from the line scan can be reorganized into image tiles according to the location of the pixels that correspond to the image tiles on the slide. These image tiles can then be stitched together into an image of the entire slide. In a tile-based scanner system, an area sensor performs image acquisition one tile at a time, where the tile corresponds to a rectangular field of view.
[0122] In both types of scanner systems, image tiles can be generated during scanning, at which time machine learning models can be applied to detect artifact pixels. For line scanners, the image data acquired from the line sensor is not an image tile. Thus, scan data can be generated every few line sweeps. The scan data can then be reorganized into image tiles, at which time machine learning models can be applied to the image tiles to detect artifact pixels. In some cases, processing can be performed using hardware components (e.g., FPGAs) and / or software components.
[0123] Artifact detection during scanning allows the scanner or scanner-associated software to alert the user to slide quality issues (e.g., type of artifact, location of artifact, size of artifact) during scanning so that the user can make a decision to save or delete a particular scan. Additionally or alternatively, artifact detection during scanning can be used by the scanner to intelligently and automatically adjust settings in response to detecting a predicted artifact. For example, autofocus parameters can be adjusted by the scanner in response to determining that artifact pixels are present in a portion of an image displaying a tissue region of a biological specimen, or that the amount of artifact pixels exceeds an artifact area threshold.
[0124] (a) Artifact detection from initial scan at low image resolution For slides with detectable tissue regions, a machine learning model can be applied to the image to generate an image mask that identifies artifact pixels and identifies the amount of artifact pixels present in the image. In some cases, artifact detection can be performed at a low image resolution. Low-resolution artifact detection can be used to detect artifact pixels that are predicted to represent artifacts that occupy a large portion of the image, including large tissue folds, large blurry areas caused by tissue folds, etc.
[0125] For example, a machine learning model can be trained to detect artifact pixels at a target image resolution. During scanning, a first scan image of a slide displaying a biological sample can be performed at the target image resolution. The machine learning model can be applied to the first scan image to identify one or more artifact pixels. An amount of artifact pixels can be determined. A value representing the amount of artifact pixels can be compared to an artifact region threshold. In some examples, the artifact region threshold corresponds to a value representing a relative size of an image portion within an image (e.g., 40%, 50%, 60%, 70%, 80%, 90%). The artifact region threshold can be selected by a user. If the amount of artifact pixels exceeds the artifact region threshold, it can be predicted that one or more artifacts are likely to occupy a large portion of the image and thus cause a performance degradation of a subsequent digital pathology analysis (e.g., cell classification). If it is determined that the value representing the amount of artifact pixels exceeds the artifact region threshold, it can be determined that there is a potential quality control failure. In some cases, a warning is generated in response to determining the quality control failure.
[0126] Additionally or alternatively, an image mask (sometimes referred to as an "artifact mask") may also be generated that includes one or more artifact pixels. The artifact mask may be used by a graphical user interface to identify portions of the image that are overlaid on the image and thus predicted to contain artifacts. This allows a user to decide whether to rescan the slide or reject the image (e.g., the user may redo the experiment to generate another image with better image quality).
[0127] If the value representing the amount of artifact pixels is determined to be below the artifact region threshold, the biological sample can be scanned at a higher image resolution for digital pathology analysis. In some cases, scanning at a higher image resolution involves switching magnification, such as using a different objective lens or changing the tube lens of the scanner. Both actions may involve moving optical elements.
[0128] Switching resolutions can involve scanning two passes through the slide, which requires additional scan time. By scanning initially at a lower resolution, the additional scan time can be minimized since the initial scan can be faster than the time required to scan the slide at the target image resolution. For example, scanning at 5x resolution can produce 1 / 16th the number of pixels compared to scanning at 20x resolution. Such a difference can mean that only a small portion of the time is required to scan at 5x. In another example, with a line scanner, if the length of the stripes / lines is large enough to cover the width (or height) of a given slide at the lower resolution, the scan can be completed in a single sweep through the slide, thus minimizing the increase in total scan time.
[0129] (b) Artifact detection by converting the scanned image to a lower image resolution. In some cases, the machine learning model is applied to the slide image after scanning the biological sample at a high image resolution and then converting the slide image to a lower image resolution. Artifact detection can be performed on the slide image before the slide image is further processed (e.g., stored in a separate database for further digital pathology analysis). Such a design can facilitate early elimination of low-quality scans before other time-consuming processes (e.g., data transfer, long-term data storage) are performed. Recent advances in computing hardware and software algorithms make such an implementation feasible, as the time to process an entire slide image at (e.g.) 20x resolution can be completed within tens of seconds.
[0130] For example, a slide displaying a biological sample can be scanned at a higher image resolution to generate an initial image. A machine learning model for detecting artifacts can be applied to the transformed image to identify one or more artifact pixels. The transformed image can be generated by transforming the initial image into an image with a lower image resolution. An amount of artifact pixels can be determined. A value representing the amount of artifact pixels can be compared to an artifact region threshold. If the value is determined to exceed the artifact region threshold, a possible quality control failure can be determined. In some cases, a warning is generated in response to determining the quality control failure. Additionally or alternatively, an artifact mask can be generated that includes the one or more artifact pixels to enable a user to rescan the slide or reject the image (e.g., the user may redo an experiment to generate another image with better image quality).
[0131] If the value is determined to be below the artifact region threshold, the initial image scanned at the higher image resolution can be accepted and directly saved in DICOM format and / or another file format. In some cases, information corresponding to the artifact pixels (e.g., the location of the artifact pixels in the initial image, an artifact mask at the same or lower image resolution as the initial image, etc.) is saved with the initial image and / or in another file format separate from the initial image. Further, subsequent digital pathology analysis can be performed on the initial image.
[0132] (c) Artifact detection per image tile. In some cases, the machine learning model can be applied to the slide image for each image tile. The slide image can be divided into a set of image tiles. The machine learning model can be applied to each image tile of the set of image tiles to generate an image mask. The image mask identifies a subset of the image tiles, each image tile of the subset of image tiles can display one or more artifact pixels. The image mask can then be applied to the image to allow a user to deselect one or more image tiles of the subset of image tiles, the deselected image tiles being excluded from further digital pathology analysis. Additionally or alternatively, the image mask can be applied to the image to select a subset of the image tiles of the image without user input and then excluded from further digital pathology analysis.
[0133] As an illustrative example, a portion of a slide of a biological specimen can be scanned to obtain a corresponding portion of an image (e.g., an image tile). The image tile can be scanned at a target image resolution. After the image tile is obtained, a machine learning model is applied to the image tile to identify one or more artifact pixels (e.g., batch size=1). In some cases, the machine learning model is applied to multiple image tiles to identify artifact pixels in each image tile (e.g., batch size≧1). The processing of multiple image tiles can be performed based on multi-processing by a GPU or a CPU.
[0134] Additional processing can be performed for each image tile having identified artifact pixels. Additional processing of image tiles having artifact pixels can include: (i) determining the amount of identified artifact pixels in the image tile (e.g., the percentage of artifact pixels relative to the total number of pixels), and (ii) determining the amount of pixels that represent tissue regions (e.g., the percentage of pixels that represent tissue regions relative to the total number of pixels). Additional processing can be performed while additional image tiles of an image are being scanned and processed by the machine learning model. In some cases, the image tiles are first downsampled to represent the biological sample at a lower image resolution, and a machine learning mode is applied to identify artifact pixels.
[0135] If the amount of artifact pixels determined from the image tile exceeds an artifact region threshold, a warning can be generated to alert a user that the image tile is predicted not to accurately represent the corresponding point or region of the biological specimen. In some cases, an artifact mask is generated in response to the above determination.
[0136] For amounts of artifact pixels representing tissue areas below the artifact area threshold, the entire slide can be scanned at the target resolution for subsequent digital pathology analysis. Additionally or alternatively, the scanning system (e.g., tile-based scanner, line-based scanner) used to generate the image tiles can be configured to modify its settings based on detection of artifact pixels. In some cases, the modification of settings, with respect to artifacts corresponding to blurred image portions, includes: (i) comparing focus quality of scanned / assembled image tiles in multiple z-planes; and (ii) excluding image tiles in z-planes where artifact pixels were identified and / or adjusting the z-planes to reduce artifacts. Such configurations can be integrated with or replace existing autofocus systems in the scanner.
[0137] 3. Additional Artifact Detection In some cases, in addition to the artifact detection of the image during scanning, post-scanning artifact detection can be performed. Post-scanning artifact detection can further improve the accuracy of the detection of artifacts in the image. For example, algorithms for artifact detection during scanning can be designed specifically for downstream digital pathology analysis or designed to be applied to other general algorithms. When it is not practical to integrate customized artifact detection algorithms into the scanner, post-scanning artifact detection can be used to maintain quality control of whole slide images for downstream digital pathology analysis.
[0138] In another example, for artifact detection at low image resolution, new or different artifacts may occur in subsequent scanning at higher image resolution.In particular, different objective lenses or tube lenses may be used, and the scans may come from different scanning operations, so that the out-of-focus image parts may be different between these two scans.Therefore, if post-scan artifact detection is not performed, new artifacts may exist, which may reduce the accuracy of downstream digital pathology analysis.
[0139] In some cases, post-scan artifact detection is more effective with respect to certain types of machine learning models. For example, post-scan artifact detection may be more effective when certain machine learning models (e.g., recurrent neural networks) integrate features from adjacent image tiles. Although image data generated during scanning can be organized during scanning to evaluate adjacent image tiles, such an approach can slow down scanning speed and / or significantly increase the computational load of hardware integrated or associated with the scanner.
[0140] V. Experimental Results An evaluation was performed to identify the performance level of machine learning models for detecting artifacts in slide images.
[0141] A. Dataset From each of the 50 whole slide images, a set of labels for identifying pixels was collected. The corresponding pixel labels relate to one of three types of classes: non-tissue, blurred tissue, and unblurred tissue. The whole slide images represent at least a portion of biological samples obtained from two cohorts (breast and lung cancer). Each biological sample was stained with one of the following: (1) hematoxylin, (2) single stains for ER, PR, PDL1, or CK7, and (3) double stains for ER / PR or PDL1 / CK7. The chromogens for the assays were Dabsyl (yellow), Tamra (purple), SRB (red), or DAB (single IHC only). The whole slide images for independent testing were from a variety of tissue types (breast, lung, liver, kidney, and colon) and from single, double, and triple assays (additional chromogen: Teal, additional biomarkers: LIV1, HER2, CD8, and BCL1).
[0142] From the 50 whole slide images, 978 image tiles were selected, each having a size of 512x512 pixels and scanned at 5x image resolution. From the selected image tiles, 462 image tiles were used for training, 246 image tiles were used for validation, and 270 image tiles were used for testing. An additional 100 whole slide images were selected for independent testing.
[0143] B. Model Selection and Configuration Two modified U-Net machine learning models were selected for evaluation. For the first machine learning model, the number of channels in the middle convolutional layer was reduced by a factor of two, resulting in Model 1 (7.76 million parameters). For the second machine learning model, the number of channels in the middle convolutional layer was reduced by a factor of four, resulting in Model 2 (1.94 million parameters).
[0144] C. Image Preprocessing and Training Each of the selected image tiles was converted to grayscale and augmented with random rescaling, flipping, contrast jittering, and intensity jittering. Each of the grayscale augmented image tiles was concatenated with its corresponding image gradient map (Laplacian filtering with kernel size 3 followed by Gaussian filtering with kernel size 25 and sigma 3). The grayscale augmented image tiles with corresponding gradient features were used to train each of the two U-Net models. Training of the two U-Net models was performed using the multi-resolution training technique described in Section III. In particular, the loss calculated from each of the last two processing blocks in the augmentation pass was utilized for pixel-level classification.
[0145] D. Results FIG. 22 shows an example set of graphs 2200 identifying precision and recall scores of machine learning models trained to detect artifact pixels. Graph 2202 shows the precision scores corresponding to Model 1 and Model 2, and graph 2204 shows the accuracy scores corresponding to Model 1 and Model 2. The precision and recall scores of each graph 2202 and 2204 are calculated based on the provided test images with corresponding labels. Note that the performance of Model 1 and Model 2 is similar in detecting artifacts. This may mean that a machine learning model with relatively few parameters (e.g., 1.94 million parameters) may be sufficiently effective in detecting artifacts.
[0146] 23 shows an example set of image masks 2300 generated for a set of unseen images from the same type of assay and the same type of tissue as the training images. Each image shows a tissue section stained using a staining protocol corresponding to a particular type of IHC assay. In FIG. 23, a predicted image mask 2302 generated from model 2 is presented along with a ground truth image mask 2304. A comparison between the predicted image mask 2302 and the ground truth image mask 2304 shows that model 2 can accurately identify artifact pixels.
[0147] Further, the trained machine learning model was applied to independent test images (i.e., the set of 100 whole slide images identified in Section VA) to identify artifact pixels. For example, FIG. 24 shows an exemplary set of image masks 2400 generated from images displaying unseen assay patterns or tissue types. FIG. 24 can be used for qualitative assessment of the machine learning model generalizability of defocus artifact detection to unseen assays and unseen tissue types.
[0148] 24, the exemplary image masks show accurate artifact detection from unseen assays 2402 and unseen tissue types 2404. The image masks further illustrate that the trained machine learning model is capable of performing accurate artifact detection for images displaying various types of biological samples and / or biological samples stained using staining protocols corresponding to different types of assays.
[0149] VI. Computing Environment 25 illustrates an example of a computer system 2500 for implementing some embodiments disclosed herein. The computer system 2500 may include a distributed architecture where some of the components (e.g., memory and processor) are part of an end-user device and some other similar components (e.g., memory and processor) are part of a computer server. In some cases, the computer system 2500 is a computer system for determining a genetic signature of interest based on a size distribution of nucleic acid molecules of a biological sample and includes at least a processor 2502, a memory 2504, a storage device 2506, an input / output (I / O) peripherals 2508, a communication peripherals 2510, and an interface bus 2512. The interface bus 2512 is configured to communicate, transmit, and transfer data, control, and commands between various components of the computer system 2500. The processor 2502 may include one or more processing units, such as a CPU, a GPU, a TPU, a systolic array, or a SIMD processor. The memory 2504 and storage 2506 include computer readable storage media such as RAM, ROM, Electrically Erasable Programmable Read Only Memory (EEPROM), hard drives, CD-ROM, optical storage devices, magnetic storage devices, electronic non-volatile computer storage devices such as flash memory, and other tangible storage media. Any such computer readable storage media may be configured to store instructions or program code embodying aspects of the present disclosure. Additionally, the memory 2504 and storage 2506 include computer readable signal media.
[0150] A computer-readable signal medium includes a propagated data signal in which computer-readable program code is embodied. Such a propagated signal may take any of a variety of forms, including, but not limited to, electromagnetic, optical, or any combination thereof. A computer-readable signal medium is not a computer-readable storage medium, but includes any computer-readable medium that can communicate, propagate, or transmit a program for use in connection with computer system 2500.
[0151] Additionally, memory 2504 includes an operating system, programs, and applications. Processor 2502 is configured to execute stored instructions and includes, for example, logic processing units, microprocessors, digital signal processors, and other processors. For example, computing system 2500 can execute instructions (e.g., program code) that configure processor 2502 to perform one or more of the operations described herein. Program code includes, for example, code to perform analysis of sequence data, and / or any other suitable application to perform one or more of the operations described herein. Instructions can include, for example, processor-specific instructions generated by a compiler or interpreter from code written in any suitable computer programming language, including C, C++, C#, Visual Basic, Java, Python, Perl, JavaScript, and ActionScript.
[0152] The program code can be stored in memory 2504 or any suitable computer readable medium and executed by processor 2502 or any other suitable processor. In some embodiments, all modules in the computer system for predicting loss of heterozygosity at HLA alleles are stored in memory 2504. In additional or alternative embodiments, one or more of these modules from the above computer systems are stored in different memory devices of different computing systems.
[0153] The memory 2504 and / or the processor 2502 may be virtualized and hosted in another computing system, for example, in a cloud network or a data center. The I / O peripherals 2508 include user interfaces such as keyboards, screens (e.g., touch screens), microphones, speakers, other input / output devices, as well as computing components such as graphical processing units, serial ports, parallel ports, universal serial buses, and other input / output peripherals. The I / O peripherals 2508 are connected to the processor 2502 via any of the ports coupled to the interface bus 2512. The communication peripherals 2510 are configured to facilitate communication between the computer system 2500 and other computing devices over a communication network, and include, for example, network interface controllers, modems, wireless and wired interface cards, antennas, and other communication peripherals. For example, computing system 2500 can communicate with one or more other computing devices (e.g., a computing device that determines genetic characteristics of a subject based on the size distribution of nucleic acid molecules in a biological sample, another computing device that generates sequence data for the subject's biological sample) over a data network using the network interface device of communication peripheral 2510.
[0154] Although the subject matter has been described in detail with respect to certain embodiments thereof, it will be understood that upon achieving the above understanding, modifications, variations, and equivalents to such embodiments may be readily made by those skilled in the art. It is therefore to be understood that the present disclosure is presented for purposes of illustration and not limitation, and does not exclude the inclusion of such modifications, variations, and / or additions to the subject matter as would be readily apparent to those skilled in the art. In fact, the methods and systems described herein may be embodied in various other forms. Furthermore, various omissions, substitutions, and changes may be made in the form of the methods and systems described herein without departing from the spirit of the present disclosure. The appended claims and their equivalents are intended to cover such forms or modifications as fall within the scope and spirit of the present disclosure.
[0155] Unless otherwise indicated, throughout this specification, discussions utilizing terms such as "processing," "computing," "calculating," "determining," and "identifying" are understood to refer to operations or processes of a computing device, such as one or more computers or similar electronic computing devices or devices, that manipulate or transform data represented as physical electronic or magnetic quantities in the memory, registers, or other information storage, transmission, or display devices of a computing platform.
[0156] The system or systems described herein are not limited to any particular hardware architecture or configuration. A computing device may include any suitable arrangement of components that provide results conditional on one or more inputs. Suitable computing devices include general-purpose microprocessor-based computing systems that access stored software that programs or configures the computing system, from general-purpose computing devices to dedicated computing devices that implement one or more embodiments of the present subject matter. Any suitable programming, scripting, or other type of language or combination of languages may be used to implement the teachings contained herein in the software used to program or configure the computing device.
[0157] Certain embodiments of the methods disclosed herein may be performed in operation of such a computing device. The order of the blocks shown in the above examples may be changed, e.g., the blocks may be rearranged, combined, and / or divided into sub-blocks. Certain blocks or processes may be performed in parallel.
[0158] Conditional language used herein, such as, among others, "can," "could," "might," "may," "eg," and the like, is intended to generally convey that certain examples include certain features, elements, and / or steps, but not other examples, unless otherwise stated or understood otherwise within the context in which it is used. Thus, such conditional language is not intended to generally imply that features, elements, and / or steps are somehow required in one or more examples, or that one or more examples necessarily include logic for determining whether those features, elements, and / or steps are included in or performed in any particular example, with or without authorial input or prompting.
[0159] Terms such as "comprising," "including," "having," and the like are synonymous and are used in an inclusive, open-ended manner and do not exclude additional elements, features, acts, operations, etc. Additionally, the term "or" is used in an inclusive (rather than exclusive) sense, e.g., when used to connect a list of elements, the term "or" may mean one, some, or all of the elements in the list. Use of "adapted to" or "configured to" herein means open, inclusive language that does not exclude devices adapted or configured to perform additional tasks or steps. Additionally, use of "based on" means open and inclusive in that a process, step, calculation, or other operation "based on" one or more enumerated conditions or values may in fact be based on additional conditions or values beyond those enumerated. Similarly, the use of "based at least in part on" is meant to be open and inclusive in that a process, step, calculation, or other action "based at least in part on" one or more recited conditions or values may in fact be based on additional conditions or values beyond those recited. The headings, lists, and numbering contained herein are for ease of description only and are not meant to be limiting.
[0160] The various features and processes described above may be used independently of each other or may be combined in various ways. All possible combinations and subcombinations are intended to fall within the scope of the present disclosure. Furthermore, in some implementations, certain method or process blocks may be omitted. The methods and processes described herein are also not limited to any particular sequence, and the blocks or states associated therewith may be performed in other sequences as appropriate. For example, the described blocks or states may be performed in an order other than the order specifically disclosed, or multiple blocks or states may be combined into a single block or state. The example blocks or states may be performed in serial, parallel, or in any other manner. Blocks or states may be added to or deleted from the disclosed examples. Similarly, the example systems and components described herein may be configured differently than described. For example, elements may be added, removed, or rearranged as compared to the disclosed examples.
Claims
1. accessing an image representative of at least a portion of the biological sample; applying an image pre-processing algorithm to the image to generate a pre-processed image, the pre-processed image including a plurality of labeled pixels, each labeled pixel of the plurality of labeled pixels having associated therewith a label that predicts whether the pixel correctly represents a corresponding point or region of the at least a portion of the biological sample; applying a machine learning model to the preprocessed image to identify one or more labeled pixels from the plurality of labeled pixels, the one or more labeled pixels being predicted to be mislabeled by the image preprocessing algorithm; and applying a machine learning model to the preprocessed image to identify one or more labeled pixels from the plurality of labeled pixels. revising a label for each of the one or more labeled pixels; generating training images including at least the one or more labeled pixels with the modified labels; outputting the training images; A method comprising:
2. The method of claim 1 , wherein the label further identifies a type of artifact, and the pixel is further predicted to display at least a portion of an artifact corresponding to the type of artifact.
3. applying a blur threshold to each labeled pixel of the plurality of labeled pixels; determining that a further labeled pixel of the plurality of labeled pixels is mislabeled based on application of the blur threshold; and revising the labels corresponding to the further labeled pixels; The method of claim 1 or 2, further comprising:
4. The method of claim 3 , wherein the blur threshold is determined based on the performance of a downstream algorithm on a set of z-axis images displaying at least a portion of the biological sample across a depth dimension.
5. The method of any one of claims 1 to 4, wherein the image pre-processing algorithms include image segmentation, morphological processing, image thresholding, image filtering, image contrast enhancement, blur detection, or a combination thereof.
6. The method of any one of claims 1 to 5, wherein the label further predicts whether the pixel displays at least a portion of an artifact associated with a particular artifact type.
7. The method of claim 6 , wherein the particular artifact types include blurred areas, tissue folds, and foreign objects.
8. accessing training images displaying at least a portion of a biological specimen, the training images including a plurality of labeled pixels, each labeled pixel of the plurality of labeled pixels having associated therewith a label that predicts whether the pixel correctly displays a corresponding point or region of the at least a portion of the biological specimen; accessing a machine learning model including a set of convolutional layers, the machine learning model configured to apply each convolutional layer of the set of convolutional layers to a feature map representing an input image; training the machine learning model to detect one or more artifact pixels in an image at a target image resolution, where an artifact pixel of the one or more artifact pixels is predicted to not accurately represent a point or region of the at least a portion of the biological specimen, the training comprising: For each labeled pixel of the plurality of labeled pixels of the training images, determining a first loss for the labeled pixels at a first image resolution by applying a first convolutional layer of the set of convolutional layers to a first feature map representing the training images at the first image resolution; determining a second loss for the labeled pixels at a second image resolution by applying a second convolutional layer of the set of convolutional layers to a second feature map representing the training images at a second image resolution, the second resolution having a higher image resolution relative to the first image resolution; and determining a total loss for the labeled pixel based on the first loss and the second loss; and determining, based on the total loss, that the machine learning model is trained to detect the one or more artifact pixels at the target image resolution; training the machine learning model to detect one or more artifact pixels in an image at a target image resolution; outputting the trained machine learning model; A method comprising:
9. 10. The method of claim 8, further comprising converting the training images to grayscale training images, wherein the machine learning model is trained using the grayscale training images.
10. 10. The method of claim 8, further comprising: converting the plurality of labeled pixels of the training images from a first color space to a second color space to generate modified training images, wherein the machine learning model is trained using the modified training images.
11. The method of claim 8 , wherein the total loss is determined based on a sum of the first loss and the second loss.
12. The method of claim 8 , wherein the total loss is determined based on an average of the first loss and the second loss.
13. The method of claim 8 , wherein the target image resolution is the first image resolution.
14. accessing an image displaying at least a portion of the biological sample, the image being at a first image resolution; accessing a machine learning model trained to detect artifact pixels in images at a second image resolution, the first image resolution having a higher image resolution relative to the second image resolution; transforming the image to generate a transformed image displaying the at least a portion of the biological sample at the second image resolution; applying the machine learning model to the transformed image to identify one or more artifact pixels from the transformed image, where an artifact pixel of the one or more artifact pixels is predicted to not accurately represent a point or region of the at least a portion of the biological specimen; and generating an output including the one or more artifact pixels; A method comprising:
15. The output is an image mask including the one or more artifact pixels, and the method further comprises: overlaying the image mask on the image to distinguish a set of pixels in the image from the one or more artifact pixels; applying a cell classification model to the set of pixels; The method of claim 14 further comprising:
16. The method of claim 14 or 15, wherein the output identifies an amount of the one or more artifact pixels.
17. A method according to any one of claims 14 to 16, further comprising using said output to adjust one or more scanning parameters of a scanning device.
18. one or more data processors; a non-transitory computer-readable storage medium containing instructions that, when executed on the one or more data processors, cause the one or more data processors to perform some or all of one or more of the methods disclosed herein; A system comprising:
19. A computer program product tangibly embodied in a non-transitory machine-readable storage medium, the computer program product comprising instructions configured to cause one or more data processors to perform some or all of the methods disclosed herein.
Citation Information
Patent Citations
Adaptive classification for whole-slide tissue segmentation
JP2017510792A
Image processing systems and methods for displaying multiple images of biological specimen
JP2021073566A
Focus-weighted machine learning classifier error prediction for microscope slide images
JP2021518025A
Cited By
Pretreatment device and program
WO2026181957A1
