Biological context for analyzing whole-slide images
The transformer-based aggregation model addresses the lack of contextual analysis in WSIs by using spatial and semantic self-attention to enhance patch embeddings, resulting in improved diagnostic accuracy for cancer prognosis.
Patent Information
- Application Number
- JP2024521026
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2021-10-07
- Filing Date
- 2022-10-07
- Publication Date
- 2024-10-29
AI Technical Summary
Existing machine learning techniques for analyzing whole slide images (WSIs) fail to capture the biological context by treating each patch independently, leading to weak slide-level labels and neglecting the interdependence of local and global patterns, which is crucial for accurate cancer diagnosis and prognosis.
A transformer-based aggregation model that employs spatial and semantic self-attention to encode patch embeddings, capturing local and global patterns within WSIs, and uses attention-based confidence regularization to reduce overemphasis on individual patches.
The model achieves state-of-the-art accuracy in tumor grading and survival prediction tasks, improving diagnostic performance by modeling cross-patch dependencies and enhancing the representation of WSIs.
Smart Images

Figure 2024539600000001_ABST
Abstract
Description
CROSS-REFERENCE TO RELATED APPLICATIONS
[0001] This application claims the benefit of and priority to U.S. Provisional Patent Application No. 63 / 253,514, filed October 7, 2021, entitled “SELF-ATTENTION FOR MULTIPLE-INSTANCE LEARNING OF WSI,” which is incorporated herein by reference in its entirety for all purposes. [Technical field]
[0002] This application relates generally to digital pathology, and more particularly to the analysis of whole slide images (WSIs). [Background technology]
[0003] Analysis of digitized whole slide images (WSIs) showing histological features is the gold standard for determining cancer diagnosis and prognosis. As clinical grade scanners become more commonplace, the possibility of using machine learning techniques to improve the diagnostic process using digital scans of WSIs is an exciting prospect. However, working with WSIs can be challenging due to the rather large size of digitized WSIs (e.g., 100K x 100K pixels is a common size). Because WSIs are so large, they are often decomposed into smaller image tiles or patches for analysis purposes, but the resulting output often only provides weak, slide-level labels rather than detailed region annotations. Standard automated analysis techniques based on machine learning methods take each patch as an independent unit during aggregation without modeling the biological context of that patch relative to other patches in the WSI. This contrasts with diagnostic practice, where pathologists refer to both microscopic (regional or local within the WSI) patterns and macroscopic (global within the WSI) context when analyzing a WSI; i.e., multiple regions of a WSI are typically selected by the pathologist as patterns of interest and evaluated as a whole to draw diagnostic and / or prognostic conclusions. Summary of the Invention
[0004] In the embodiments disclosed herein, a transformer-based aggregation model may model cross-patch dependencies between patches in the WSI to capture local and global patterns in the WSI. The transformer-based aggregation model may encode embeddings for each patch with two types of self-attention: semantic self-attention on the appearance of all other patches in the slide to model slide-level patterns as a global context, and spatial self-attention on nearby patches to remove ambiguity of local patterns. Furthermore, attention-based confidence regularization may be utilized to reduce over-emphasis on a single patch for prediction.
[0005] In an embodiment disclosed herein, a computer-implemented method for analyzing a whole slide image (WSI) in the context of a biological context may include extracting an embedding for each of a set of patches sampled from the WSI. The embedding may represent one or more histological features of the respective patch of the WSI. For each of the patches, the corresponding embedding may be encoded with a spatial context and a semantic context. The spatial context may represent a local pattern related to one or more histological features, and the local visual pattern extends beyond the corresponding patch to an area in the WSI. The semantic context may represent a global pattern that spans the WSI as a whole. A representation for the WSI may be generated by combining the encoded patch embeddings. Finally, a pathology task may be performed based on the representation for the WSI.
[0006] The patches may be sampled by applying a hierarchical sampling strategy to a randomly selected plurality of clusters of patches. The hierarchical sampling strategy may be applied to each of the randomly selected clusters by randomly sampling the centroid of the cluster, determining for each of the patches in the cluster the distance of the patch to the centroid, and randomly sampling all patches in the cluster that have a distance to the centroid within a threshold distance. The threshold distance may be based on a pathological task.
[0007] Encoding the embedding in a spatial context may include using a spatial encoder to encode the embedding with spatial attention by attending to the embedding of one or more nearby patches in the set. Nearby patches may be defined as those within a maximum relative distance corresponding to a specified pathological type of WSI. Input for the spatial encoder may include a position of the corresponding patch and a sequence of absolute positions of the nearby patches. The absolute positions may be normalized to correspond to a standard level of magnification.
[0008] Encoding the embeddings in the semantic context of the corresponding patch may include using a semantic encoder to encode the embeddings with semantic attention by attending to the embeddings of other patches in the set. The semantic encoder may be a bidirectional self-attention encoder with a multi-head attention layer. The semantic encoder may attend to the embeddings of other patches in the set. Input for the semantic encoder may include embeddings of other patches in the set and the learnable tokens.
[0009] During the training phase, generating a representation of the WSI based on the encoded patch embeddings may include generating an auxiliary representation based on the encoded learnable tokens.
[0010] The semantic context may be further enhanced by regularizing the semantic attention to reduce overemphasis on a few patches for generating a representation for the WSI. Regularizing the semantic attention may include using a rollout operation to compute an attention map across all of the semantic attentions encoded for embeddings corresponding to the patches sampled from the WSI. The negative entropy of the attention map may then be added as a hinge loss to the training objective of the transformer model.
[0011] Combining the encoded patch embeddings may include taking an average of the encoded embeddings.
[0012] Performing a pathology task based on the annotations of the WSI may include classifying one or more histological features extracted from the WSI, classifying a pathology type of the WSI, predicting a disease progression risk associated with one or more histological features, or determining a patient diagnosis associated with the WSI. The pathology task may be performed using a classifier model or a regressor model.
[0013] One or more computer-readable, non-transitory storage media embodying software, the software including instructions that, when executed, are operable to perform the steps of the methods disclosed herein.
[0014] A system comprising one or more processors and a memory coupled to the processors and containing instructions executable by the processors, the system being operable, when the processor executes the instructions, to perform steps of the methods disclosed herein.
[0015] In an embodiment disclosed herein, a computer-implemented method for analyzing a whole slide image (WSI) in the context of a biological context may include extracting an embedding for each of a set of patches sampled from the WSI, the embedding representing one or more histological features of each patch of the WSI. For each patch, a spatial encoder may encode the embedding corresponding to the patch with spatial attention by attending to the embeddings of nearby patches in the set, the spatial attention models attention to microscopic visual patterns related to one or more histological features, the microscopic visual patterns extending beyond the corresponding patch to regions in the WSI, and a semantic encoder may encode the embedding corresponding to the patch with semantic attention by attending to the embeddings of all other patches in the set, the semantic attention models attention to macroscopic visual patterns extending over the WSI as a whole. A representation for the WSI may be generated by combining the encoded patch embeddings, and a pathology task may be performed based on the representation for the WSI.
[0016] The above disclosed embodiments are merely examples, and the scope of the disclosure is not limited thereto. Particular embodiments may include all, some, or none of the components, elements, features, functions, operations, or steps of the above disclosed embodiments. Embodiments according to the invention are disclosed in the appended claims, which are particularly directed to methods, storage media, systems, and computer program products, and any feature recited in one claim category, e.g., a method, may also be claimed in another claim category, e.g., a system. Dependencies or references in the appended claims are selected for formality reasons only. However, subject matter resulting from intentional reference (especially multiple dependencies) to previous claims may also be claimed, such that any combination of a claim and its features may be claimed regardless of the dependencies disclosed and selected in the appended claims. Subject matter that may be claimed includes not only the combination of features recited in the appended claims, but also any other combination of features in the claims, and each feature recited in the claims may be combined with any other feature or other combination of features in the claims. Furthermore, any of the embodiments and features described or shown in this specification may be claimed in a separate claim and / or in any combination with any of the embodiments or features described or shown in this specification or with any of the features of the appended claims.
[0017] 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. [Brief description of the drawings]
[0018] [Figure 1] FIG. 1 illustrates a network of interacting computer systems. [Diagram 2] FIG. 1 illustrates an exemplary model for analyzing WSI in the context of a biological context. [Diagram 3]1 is a flowchart illustrating steps in an exemplary method for analyzing a WSI in light of biological context information. [Figure 4A] FIG. 1 shows an example of a whole slide image with annotated tumor regions. [Figure 4B] A close-up of the annotated tumor region shown in FIG. 4A. [Figure 4C] FIG. 1 illustrates an example of attention map visualization utilizing attention-based multiple instance learning techniques. [Figure 4D] A magnification of the non-tumor area shown in FIG. 4C. [Figure 4E] FIG. 1 illustrates an example of attention map visualization utilizing semantic self-attention techniques. [Figure 4F] A magnification of the non-tumor area shown in FIG. 4E. [Figure 4G] FIG. 1 illustrates an example of attention map visualization that utilizes semantic self-attention techniques and an entropy-based attention regularizer. [Figure 4H] FIG. 1 illustrates an example of attention map visualization that utilizes semantic self-attention techniques, an entropy-based attention regularizer, and spatial self-attention techniques. [Figure 4I] FIG. 4C shows a comparison between the attention maps of FIG. 4G and FIG. 4H for the annotated tumor region. [Figure 4J] FIG. 4C shows a comparison between the attention maps of FIG. 4G and FIG. 4H for non-tumor regions. [Diagram 5] FIG. 1 illustrates an exemplary computer system. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0019] Multi-instance learning can be used to address both the need to decompose the WSI into smaller image patches as well as the problem with weak, slide-level labels. Multi-instance learning operates at the patch level to identify patches (e.g., regions) of the WSI that contribute to weak labels. The WSI is decomposed into smaller patches, and then, using only the weak slide-level labels, a neural network is trained to identify which patches contribute to the slide-level labels. Here, the main difficulty of multi-instance learning is in aggregating patch-level insights to the slide level.
[0020] In general, multiple instance learning models applied to the analysis of WSIs start by treating each WSI as a "bag" of patches. Labels for the bags are predicted by (i) patch feature extraction and (ii) feature aggregation. The aggregated features are then used as a slide representation for the final prediction. To achieve feature aggregation, some techniques may rely on handcrafted operations, e.g., max pooling, while others may utilize learnable networks to predict aggregation weights for patches conditional on the visual semantics of the patches in order to highlight the most relevant patches for diagnosis among the common irrelevant ones. However, common multiple instance learning methods take each patch as an independent unit without taking into account the biological context of that patch during aggregation. This is in contrast to diagnostic pathology practice, where pathologists look at both microscopic patterns and their macroscopic context.
[0021] Some techniques consider cross-patch dependencies during aggregation. One exemplary technique deploys a graph neural network over predefined regions of interest as vertices to capture significant regions of a slide. In another exemplary technique, a single distance layer is trained to measure semantic similarity between important patches and other patches to estimate the patch's contribution to the slide-level label. In these techniques, only dependencies across a selected subset of patches are modeled, e.g., dependencies related to a single important patch or dependencies across predefined regions.
[0022] In this embodiment, the transformer-based aggregation model models the cross-patch dependencies between all patches in a set of selected patches from the WSI to capture local and global patterns in the WSI. After generating embeddings (e.g., feature vectors representing unique histological features associated with a particular pathology) of the selected patches, a self-attention mechanism encodes the embeddings for each of the patches by combining information from some others of the embeddings into a representation of a focal embedding. In detail, the transformer-based aggregation model includes two types of self-attention for each patch: (i) semantic self-attention, which combines information about the appearance of all other patches in the slide to model the slide-level pattern as a global context (e.g., macroscopic context), and (ii) spatial self-attention, which combines information about nearby patches to remove ambiguity of local patterns (e.g., microscopic context). Furthermore, attention-based confidence regularization is utilized to reduce overemphasis on a single patch for prediction. The functionality of transformer-based aggregation models with tumor grading classification tasks (eg, using a classifier model) and survival prediction regression tasks (eg, using a regressor model) are described herein.
[0023] To comprehensively evaluate the transformer-based aggregation model, two different types of pathological tasks are tested: tumor grading in prostate cancer and survival prediction in lung cancer. Both tasks are challenging due to the complex underlying pathological mechanisms. Our method achieves new state-of-the-art accuracy in both tasks, outperforming existing results by 3.59% and 1.64% in kappa score and C-index, respectively.
[0024] FIG. 1 illustrates a network of interacting computer systems 100 that may be used as described herein in accordance with some embodiments of the present disclosure.
[0025] The whole slide imaging system 120 may generate one or more whole slide images corresponding to a particular sample or other related digital pathology images. For example, an image generated by the whole slide imaging system 120 may include a stained section of a biopsy sample. As another example, an image generated by the whole slide imaging system 120 may include a slide image of a liquid sample (e.g., a blood film). As another example, an image generated by the whole slide imaging system 120 may include fluorescent microscopy, such as a slide image showing fluorescent in situ hybridization (FISH) after a fluorescent probe has been bound to a target DNA or RNA sequence.
[0026] Some types of samples (e.g., samples including biopsies, solid samples, and / or tissues) may be processed by the sample preparation system 121 to fix and / or embed the sample. The sample preparation system 121 may facilitate infiltrating the sample with a fixating agent (e.g., a liquid fixing agent such as a formaldehyde solution) and / or an embedding substance (e.g., histological wax). For example, a sample fixation subsystem may fix the sample by exposing the sample to a fixative agent for at least a threshold amount of time (e.g., at least 1 hour, at least 6 hours, or at least 13 hours). A dehydration subsystem may dehydrate the sample (e.g., by exposing the fixed sample and / or portions of the fixed sample to one or more ethanol solutions) and potentially clear the dehydrated sample using a clearing intermediate (e.g., including ethanol and histological wax). The sample embedding subsystem may infiltrate the sample with heated (e.g., and therefore liquid) histological wax (e.g., one or more times during a corresponding predefined time period). The histological wax may include paraffin wax and potentially one or more resins (e.g., styrene or polyethylene). The sample and wax may then be cooled, and the wax-infiltrated sample may then be blocked out.
[0027] A sample slicer 122 may receive the fixed and embedded sample and may create a set of sections. The sample slicer 122 may cool or expose the fixed and embedded sample to a cold temperature. The sample slicer 122 may then cut the cooled sample (or a trimmed version thereof) to create a set of sections. Each section may have a thickness that is (for example) less than 100 μm, less than 50 μm, less than 10 μm, or less than 5 μm. Each section may have a thickness that is (for example) greater than 0.1 μm, greater than 1 μm, greater than 2 μm, or greater than 4 μm. Cutting of the cooled sample may be performed in a warm water bath (for example, at a temperature of at least 10° C., at least 15° C., or at least 40° C.).
[0028] An automated staining system 123 may facilitate staining one or more of the sample sections by exposing each section to one or more staining agents. Each section may be exposed to a predefined amount of staining agent for a predefined period of time. In some cases, a single section is exposed to multiple staining agents simultaneously or sequentially.
[0029] Each of the one or more stained sections may be presented to an image scanner 124 that may capture a digital image of the section. The image scanner 124 may include a microscope camera. The image scanner 124 may capture digital images at multiple levels of magnification (e.g., using a 10x objective, a 20x objective, a 40x objective, etc.). Manipulation of the images may be used to capture selected portions of the sample at a desired range of magnifications. The image scanner 124 may further capture annotations and / or morphometric results identified by a human operator. In some cases, the sections are returned to the automated staining system 123 after one or more images have been captured so that the sections may be washed, exposed to one or more other stains, and imaged again. When multiple dyes are used, the dyes may be selected to have different color profiles such that a first region of the image corresponding to a first section portion that has absorbed a large amount of a first dye may be distinguished from a second region of the image (or a different image) corresponding to a second section portion that has absorbed a large amount of a second dye.
[0030] It will be appreciated that one or more components of the whole slide imaging system 120 may, in some cases, operate in conjunction with a human operator. For example, the human operator may move samples through various subsystems (e.g., of the sample preparation system 121 or of the whole slide imaging system 120) and / or initiate or terminate operation of one or more subsystems, systems, or components of the whole slide imaging system 120. As another example, some or all of one or more components of the whole slide imaging system (e.g., one or more subsystems of the sample preparation system 121) may be partially or entirely replaced by the actions of a human operator.
[0031] Furthermore, while the various described and illustrated features and components of the whole slide imaging system 120 relate to processing solid and / or biopsy samples, it will be appreciated that other embodiments may relate to liquid samples (e.g., blood samples). For example, the whole slide imaging system 120 may receive a liquid sample (e.g., blood or urine) slide including a base slide, a dirty liquid sample, and a cover. The image scanner 124 may then capture an image of the sample slide. Further embodiments of the whole slide imaging system 120 may relate to capturing an image of the sample using advanced imaging techniques such as FISH described herein. For example, once a fluorescent probe is introduced into the sample and allowed to bind to the target sequence, appropriate imaging may be used to capture an image of the sample for further analysis.
[0032] A given sample may be associated with one or more users (e.g., one or more physicians, laboratory technicians, and / or health care providers) during processing and imaging. Associated users may include, by way of example and not limitation, a person who ordered the test or biopsy that produced the sample being imaged, a person authorized to receive the results of the test or biopsy, or a person who performed an analysis of the test or biopsy sample, among others. For example, a user may correspond to a physician, pathologist, clinician, or subject. A user may use one or more user devices 130 to submit one or more requests (e.g., identifying a subject) for a sample to be processed by whole slide imaging system 120 and for the resulting images to be processed by whole slide imaging system 110.
[0033] The whole slide image generation system 120 may transmit the image generated by the image scanner 124 back to the user device 130. The user device 130 then communicates with the whole slide image processing system 110 to initiate automatic processing of the image. In some cases, the whole slide image generation system 120 provides the image generated by the image scanner 124 directly to the whole slide image processing system 110, e.g., at the direction of a user of the user device 130. Although not shown, other intermediate devices (e.g., a data store of a server connected to the whole slide image generation system 120 or the whole slide image processing system 110) may also be used. Furthermore, for simplicity, only one whole slide image processing system 110, image generation system 120, and user device 130 are shown in the network 100. The present disclosure contemplates the use of one or more of each type of system and its components without necessarily departing from the teachings of the present disclosure.
[0034] The network 100 and associated systems shown in FIG. 1 may be used in a variety of contexts where the scanning and evaluation of digital pathology images, such as whole slide images, is an essential component of the work. As one example, the network 100 may be associated with a clinical environment where a user is evaluating a sample for possible diagnostic purposes. The user may review the image using the user device 130 prior to providing the image to the whole slide image processing system 110. The user may provide additional information to the whole slide image processing system 110 that may be used to guide or direct the analysis of the image by the whole slide image processing system 110. For example, the user may provide a predicted diagnosis or preliminary assessment of features within the scan. The user may also provide additional context, such as the type of tissue being reviewed. As another example, the network 100 may be associated with a laboratory environment where tissue is being examined, for example, to determine the efficacy or potential side effects of a drug. In this context, it may be common for multiple types of tissue to be submitted for review to determine the effects of the drug on the whole body. This may present particular challenges to a human scan reviewer who may need to determine various contexts of the image that may be highly dependent on the type of tissue being imaged. These contexts may optionally be provided to the whole slide imaging system 110.
[0035] The whole slide image processing system 110 may process the digital pathology images, including the whole slide images, to classify the digital pathology images and generate annotations for the digital pathology images and related outputs. The patch sampling module 111 may identify a set of patches for each digital pathology image. To define the set of patches, the patch sampling module 111 may segment the digital pathology image into a set of patches. As embodied herein, the patches may be non-overlapping (e.g., a patch includes pixels of an image that are not included in any other patch) or overlapping (e.g., a patch includes some portion of pixels of an image that are included in at least one other patch). Features such as whether the patches overlap, in addition to the size of each patch and its centroid (e.g., image distance or pixels between the centroid of the patch and the centroid of a nearby patch), may increase or decrease the data set for analysis, and sampling a larger number of patches from the WSI (e.g., through overlapping or smaller patches) may increase the potential resolution of the final output and visualization. In some cases, the patch sampling module 111 defines a set of patches for the image, where each tile is of a predefined size and / or the offset between tiles is predefined.
[0036] Furthermore, the patch sampling module 111 may create multiple sets of tiles of various sizes, overlaps, step sizes, etc. for each image. In some embodiments, the digital pathology image itself may contain tile overlaps that may result from the imaging technique. Even segmentation without tile overlaps may be a preferred solution to balance tile processing requirements and avoid impacts on embedding and weighting value generation described herein. The tile size or tile offset may be determined, for example, by calculating one or more performance metrics (e.g., precision, recall, accuracy, and / or error) for each size / offset, and by selecting a tile size and / or offset for one or more performance metrics above a predefined threshold and / or associated with one or more optimal (e.g., highest precision, highest recall, highest accuracy, and / or lowest error) performance metrics.
[0037] The patch sampling module 111 may further define the tile size depending on the type of anomaly being detected. For example, the patch sampling module 111 may be configured with knowledge of the type(s) of tissue anomaly that the whole slide image processing system 110 will be searching for, and may customize the tile size depending on the tissue anomaly to optimize detection. For example, the patch sampling module 111 may determine that when the tissue anomaly includes searching for inflammation or necrosis in lung tissue, the tile size should be reduced to increase scan speed, and when the tissue anomaly includes Kupffer cell anomalies in liver tissue, the tile size should be expanded to increase the chances that the whole slide image processing system 110 will holistically analyze the Kupffer cells. In some cases, the patch sampling module 111 defines a set of tiles, and for each image, the number of tiles in the set, the size of the tiles of the set, the resolution of the tiles for the set, or other related properties are defined and held constant for each of the one or more images.
[0038] As embodied herein, the patch sampling module 111 may further define a set of tiles for each digital pathology image along one or more color channels or color combinations. As an example, the digital pathology image received by the whole slide image processing system 110 may include a large format, multi-color channel image having a pixel color value for each pixel of the image designated for one of several color channels. Examples of color specifications or color spaces that may be used include RGB, CMYK, HSL, HSV, or HSB color specifications. The set of tiles may be defined based on segmenting the color channels and / or generating a luminance map or grayscale equivalent for each tile. For example, for each segment of the image, the patch sampling module 111 may provide a red tile, a blue tile, a green tile, and / or a luminance tile, or an equivalent for the color specification used. As described herein, segmenting the digital pathology image based on the segments of the image and / or the color values of the segments may improve the accuracy and recognition rate of the network used to generate embeddings for the tiles and images, as well as to create classifications for the images.
[0039] Additionally, the whole slide image processing system 110 may convert between color specifications and / or prepare copies of tiles using multiple color specifications, for example, using the patch sampling module 111. The color specification conversion may be selected based on the desired type of image enhancement (e.g., emphasizing or enhancing a particular color channel, saturation level, brightness level, etc.). The color specification conversion may also be selected to improve compatibility between the whole slide image generation system 120 and the whole slide image processing system 110. For example, a particular image scanning component may provide output in an HSL color specification, and the model used in the whole slide image processing system 110 may be trained using an RGB image, as described herein. Converting the tiles to a compatible color specification may ensure that the tiles can still be analyzed. Additionally, the whole slide image processing system may upsample or downsample images provided at a particular color depth (e.g., 8-bit, 16-bit, etc.) so that they are usable by the whole slide image processing system. Additionally, the whole-slide image processing system 110 may transform the tiles depending on the type of image captured (eg, a fluorescent image may contain more detail in terms of color intensity or a wider range of colors).
[0040] As described herein, the patch embedding and encoding module 112 may generate an embedding for each patch in the corresponding feature embedding space. In certain embodiments, the patch embedding and encoding module 112 may incorporate one or more aspects of a transformer-based aggregation model. The embedding may be represented by the whole slide image processing system 110 as a feature vector for the patch. The patch embedding and encoding module 112 may use a neural network (e.g., a convolutional neural network (CNN)) to generate a feature vector representing each patch of the image. In certain embodiments, the CNN used by the patch embedding and encoding module 112 may be customized to handle the large number of patches of large format images, such as digital pathology whole slide images. Additionally, the CNN used by the patch embedding and encoding module 112 may be trained using a custom dataset. For example, the CNN may be trained using various samples of whole slide images, or even trained using samples related to the subject matter (e.g., scans of a particular tissue type) for which the embedding network is to generate embeddings. Training the CNN with a specialized or customized set of images may enable the CNN to identify finer differences between patches, which may result in more detailed and accurate distances between patches in the feature embedding space, at the expense of additional time to acquire the images and the computational and economic costs of training multiple patch sampling networks for use by the patch embedding and encoding module 112. The patch embedding and encoding module 112 may select from a library of CNNs based on the type of image being processed by the whole slide image processing system 110.
[0041] As described herein, the patch embedding may be generated from a deep learning neural network using visual features of the patch. The patch embedding may further be generated from contextual information related to the patch or from the content depicted in the patch. For example, the patch embedding may include one or more features indicative of and / or corresponding to morphological features of the depicted object (e.g., size or aberration of the depicted cell and / or density or aberration of the depicted cell). The morphological features may be measured absolutely (e.g., width expressed in pixels or converted from pixels to nanometers) or relative to other patches from the same digital pathology image, from a class of digital pathology images (e.g., created using similar techniques or by a single whole slide imaging system or scanner), or from a related family of digital pathology images. Additionally, the patch may be classified before the patch embedding and encoding module 112 generates an embedding for the patch, such that the patch embedding and encoding module 112 takes the classification into account when preparing the embedding.
[0042] For consistency, the patch embedding and encoding module 112 may create embeddings of a predefined size (e.g., a vector of 512 elements, a vector of 2048 bytes, etc.). The patch embedding and encoding module 112 may create embeddings of various and arbitrary sizes. The temporal embedding module 112 may adjust the size of the embedding based on user direction, or may be selected to optimize, for example, computational efficiency, accuracy, or other parameters. In certain embodiments, the embedding size may be based on the limitations or specifications of the deep learning neural network that generated the embedding. Larger embedding sizes may be used to increase the amount of information captured in the embedding and improve the quality and accuracy of the results, while smaller embedding sizes may be used to improve computational efficiency.
[0043] The patch embedding and encoding module 112 may also encode the embedding for each patch with spatial and semantic attention. Encoding the embedding with spatial attention may model a local visual pattern related to one or more histological features in the patch, where the local visual pattern spans regions in the WSI beyond the corresponding patch. Encoding the embedding with semantic attention may model a global visual pattern across the WSI as a whole. The spatial and semantic attention may be aggregated to determine a total attention for the patch.
[0044] The hole slide image access module 113 may manage requests to access hole slide images from other modules of the hole slide image processing system 110 and the user device 130. For example, the hole slide image access module 113 receives a request to identify a hole slide image based on a particular patch, patch identifier, or hole slide image identifier. The hole slide image access module 113 may perform the tasks of verifying that the hole slide image is available to the requesting user, identifying the appropriate database from which to retrieve the requested hole slide image, and retrieving any additional metadata that may be of interest to the requesting user or module. Additionally, the hole slide image access module 113 may handle efficiently streaming the appropriate data to the requesting device. As described herein, the hole slide image may be provided to the user device in chunks based on the likelihood that the user will want to view portions of the hole slide image. The hole slide image access module 113 may determine which regions of the hole slide image should be provided and how best to provide them. Additionally, the whole slide image access module 113 can be authorized within the whole slide image processing system 110 to ensure that individual components do not lock or otherwise misuse the database or whole slide images to the detriment of other components or users.
[0045] The output generation module 114 of the whole slide imaging system 110 may generate output corresponding to the result patches and result whole slide image data sets based on the user request. As described herein, the output may include various visualizations, interactive graphics, and reports based on the type of request and the type of data that is available. In many embodiments, the output will be provided to the user device 130 for display, but in some embodiments, the output may be accessed directly from the whole slide imaging system 110. The output will be based on the presence of and access to the appropriate data, and thus the output generation module will necessarily be authorized to access metadata and de-identified patient information as needed. As with other modules of the whole slide imaging system 110, the output generation module 114 may be updated and improved in a modular manner such that new output features may be provided to users without requiring significant downtime.
[0046] The general techniques described herein may be integrated into a variety of tools and use cases. For example, as described, a user (e.g., a pathologist or clinician) may access a user device 130 in communication with the whole slide image processing system 110 and provide a query image for analysis. The whole slide image processing system 110, or a connection to the whole slide image processing system, may be provided as a standalone software tool or package that searches for corresponding matches, identifies similar features, and generates appropriate output for the user upon request. As standalone tools or plug-ins that may be purchased or licensed on a streamlined basis, the tools may be used to augment the capabilities of a research or clinical laboratory. Additionally, the tools may be integrated into services made available to customers of the whole slide image generation system. For example, the tools may be provided as a unified workflow, where a user who directs or requests a whole slide image to be created automatically receives a report of notable features within that image and / or similar previously indexed whole slide images. Thus, in addition to improving whole slide image analysis, these techniques may be integrated into existing systems to provide additional features not previously considered or possible.
[0047] Moreover, the whole slide image processing system 110 may be trained and customized for use in a particular setting. For example, the whole slide image processing system 110 may be trained for use in providing insights related to a particular type of tissue (e.g., lung, heart, blood, liver, etc.). As another example, the whole slide image processing system 110 may be trained to assist in safety assessment, for example, in determining the level or degree of toxicity associated with a drug or other potential therapeutic treatment. Once trained for use in a particular subject or use case, the whole slide image processing system 110 is not necessarily limited to that use case. Training may be performed in a particular context, for example, toxicity assessment, with a relatively larger set of images that have been at least partially labeled or annotated.
[0048] FIG. 2 shows an example overview of the transformer-based aggregation model. The patch embeddings extracted from a convolutional neural network (CNN) encoder 210 are further augmented with semantic self-attention (see 220) and spatial self-attention (see 230) to provide visual context. The average of the encoded patch embeddings is used as the final slide representation, while the CLS token output ("e") is used as the final slide representation. [CLS] ") may be used as input to the classification layer, as well as an auxiliary loss for training (see 240). To avoid over-attention to a few patches, a regularization based on the attention rollout method may be derived as a learning objective (see 250). To enable learning of spatial self-attention, a hierarchical sampling strategy may be applied (see 270). Together with the final readout of the obtained slide representation for a specific downstream task (see 260), the entire transformer-based aggregation model may be optimized in an end-to-end manner.
[0049] The multiple instance learning formulation can be followed by considering each WSI as a bag B containing multiple instances of patch x, so that B={x1, x2, ..., x n}, where x i ∈χ. Each bag has a label y according to the instance it contains, but the instance labels are unknown. The bag label estimation is TIFF2024539600000002.tif7170, f may be a feature extraction transformation, and g may be a permutation-invariant transformer-based aggregation model. FIG. 2 shows the overall architecture of the disclosed transformer-based aggregation model g. Initial features are extracted for each patch by using a pre-trained CNN encoder (210). However, in principle, any feature representation learning technique can be used for this step. After application of the transformer-based aggregation model, task-dependent readout can be used for downstream tasks (260).
[0050] Semantic and spatial self-attention may be explicitly encoded in two separate types of encoders. Semantic encoding (220) models global, or macroscopic, visual patterns, and the semantic encoding correlates patch P with the whole slide by attending to the embeddings of all other patches with respect to patch P as semantic context (e.g., enhancing the embedding of patch P by encoding patch P with contextual information from other embeddings). This is motivated by the context of clinical diagnosis, where the influence of local sub-cellular patterns may depend on the coexistence of other patterns in the slide. Such semantic dependency may be realized, in one non-limiting example, by using a bidirectional self-attention encoder with a multi-head attention layer 222, an addition and normalization layer 224, and a feedforward layer(s) 226, where the explicit cross-attention of patch j to patch i is given by: Shown as TIFF2024539600000003.tif11170. As an example, the appearance of Gleason scale 3 tissue may be a key indication for grade 1 prostate cancer, but it is less significant when Gleason scale 4 glands predominate in the WSI, which is the case for more aggressive prostate cancer. The semantic encoder can be implemented as a bidirectional encoder with a multi-head attention layer, taking a 1D sequence of patch embeddings {w1, w2, ..., x n} is appended with a learnable token ("[CLS]") as input. Since the spatial encoder explicitly models the relative positions of the two patches, no position embedding is included in the input token.
[0051] Since subcellular structures may be of different scales in WSI, spatial encoding models regional visual patterns that extend beyond the scope of a single patch. This embodiment may incorporate spatial encoding with a separate self-attention mechanism. In particular, bidirectional self-attention between all patches within a local region is modeled. This spatial self-attention method may be separated from the semantic self-attention described above by conditioning only on the relative distance between two patches.
[0052] As shown in 230, the input to the spatial encoder is a sequence of absolute positions of the WSI patches {p1, p2, ..., p n}. Since various WSIs may have different resolutions, the positions are preprocessed to a standard scale factor. As the spatial attention between patch i and patch j, TIFF2024539600000004.tif9170, where the value is TIFF2024539600000005.tif8170, where W P ∈R k is the learnable relative position correlation, and k is the maximum relative distance beyond which spatial dependence is modeled, beyond which the value W P The value of k can be determined based on prior pathological knowledge for a particular type of WSI. In all semantic encoders described in Fig. 2(b), the total self-attention α ij is a combination of spatial and semantic attention, i.e. It could be TIFF2024539600000006.tif8170.
[0053] Furthermore, the transformer-based aggregation model applies a hierarchical sampling strategy, where K spatially clustered groups of N / K instances are selected without overlap for a required bag size N. The cluster centroids are randomly sampled to be in the tissue region of the WSI. All instances in a group are randomly sampled within a maximum distance of D pixels from the centroid, which may be determined based on the dimensions of subcellular structures in a particular pathological task. This approach is designed to sample enough samples to learn spatial self-attention encoding. See 270.
[0054] Two aggregation operations are designed to generate a slide representation e from the extended patch embeddings, as shown at 240. First, a learnable classification (CLS) token ("[CLS]") may be added to the sequence of patch embeddings prior to the encoding step, but not to its final state after multi-layer encoding ("[e [CLS] ") can be taken as a representation. Appending a CLS token to a sequence of patch embeddings allows the CLS token to be encoded with all of the representative information of all of the patch embeddings in the sequence. The BERT transformer model provides an example of the use of CLS tokens being added to a sequence of embeddings. Devlin, J. et al.: BERT: Pre-training of deep bidirectional transformers for language understanding, arXiv preprint arXiv:1810.04805 (2018). Second, a pooling layer 242 that averages all the augmented patch embeddings is added to the embeddings ("e avg By using both aggregations, features shared across both may have broader support from the input data, and may be used as a sliding representation. avg We use e as the auxiliary embedding for training the objective CLS Using the above may achieve the best performance.
[0055] Attention-based regularization can reduce overconfidence in a few patches for diagnosis. This is primarily motivated by the clinical practice of pathologists, where multiple regions across multiple patches are typically chosen as patterns of interest and evaluated as a whole for diagnostic conclusions. In particular, attention-based regularization can be implemented using an attention rollout operation as described in Abnar, S. et al., arXiv:2005.00928v2 (May 31, 2020) "Quantifying Attention Flow in Transformers". To implement regularization, an attention rollout operation is performed across a multi-layer semantic self-attention to apply a global attention A on the WSI. rollout Then we can calculate the negative entropy of the global attention map, -H(p(A rollout │w) can be added to the overall training objective L as a hinge loss, where L=L task +βmax(0,TH(p(A rollout │w))). L task is the task-specific loss, β is a weight for controlling the strength of attention-based regularization, and T is a threshold for attention distribution, below which confidence penalization can be applied to the WSI.
[0056] 3 is a flow chart showing steps in an exemplary method 300 for analyzing a WSI in light of biological context information. In step 310, patches may be sampled from the WSI. A hierarchical sampling strategy may be applied to randomly selected clusters of patches. Cluster centroids may be randomly sampled in tissue regions of the WSI. All patches in a cluster may be randomly sampled within a maximum distance of D micrometers from the centroid (rather than a fixed pixel distance, since slides may have different resolutions). The value of the maximum distance may be determined based on the dimensions of subcellular structures in a particular pathological task.
[0057] In step 320, an embedding may be extracted for each of the patches sampled from the WSI, where the embedding represents one or more histological features of the respective patch of the WSI. The embedding may be extracted using a CNN encoder pre-trained to extract the one or more histological features. The CNN encoder may output a one-dimensional sequence of patch embeddings.
[0058] In step 330, the embedding for each of the patches may be encoded with spatial and semantic attention. Spatial attention may model attention to local visual patterns related to one or more histological features. The local visual patterns may span regions in the WSI beyond the corresponding patch. Semantic attention may model attention to global visual patterns across the WSI as a whole.
[0059] Encoding the embedding with spatial attention (step 332) may include using a spatial encoder to encode the embedding by paying attention to the embedding of one or more nearby patches in the set (e.g., enhancing the embedding of the focal patch by encoding it with contextual information from the embedding of the nearby patches). The nearby patches may be defined as those that are within a maximum relative distance corresponding to a specified pathological type of WSI. Input for the spatial encoder may include a position embedding of the corresponding patch and a sequence of position embeddings (e.g., absolute positions) of the nearby patches. The position embeddings may be determined based on normalizing each of the patches to a standard level of magnification.
[0060] Encoding the embedding with semantic attention (step 334) may include using a semantic encoder to encode the embedding by paying attention to the embeddings of other patches in the set (e.g., enhancing the embedding of the focal patch by encoding it with contextual information from the embeddings of all other sampled patches in the set). The semantic encoder may be a bidirectional self-attention encoder with a multi-head attention layer, where the semantic encoder pays attention to the embeddings of other patches in the set. Input for the semantic encoder may include embeddings of other patches in the set and a learnable token ("[CLS]"). In some embodiments, the input may include a one-dimensional sequence of other patch embeddings prepended with the learnable token. During the training phase, an auxiliary representation of the WSI may be generated based on the encoded learnable token.
[0061] The encoded patch embeddings may be combined to generate a representation for the WSI, at step 340. Combining the encoded patch embeddings may include averaging the encoded embeddings.
[0062] At step 350, downstream pathology tasks may be performed based on the representation for the WSI. The downstream pathology tasks may include, by way of example and not limitation, classifying one or more histological features extracted from the WSI, classifying a pathology type of the WSI, predicting a risk of disease progression associated with one or more histological features, or determining a patient diagnosis associated with the WSI.
[0063] As explained above, attention-based regularization can be used to reduce the overemphasis on a few patches. i ->w jThe attention map of patch i to all patches (such as ) can be computed in a rollout operation across all semantic attentions. Spatial attentions are not included since they should be consistent everywhere across the WSI. A rollout The overall attention map of the WSI, denoted as e, is the average of the attention maps at all output tokens (e.g., e i ) can be calculated as follows: rollout The negative entropy of is added to the training objective as a hinge loss, L reg =βmax(0,TH(p(A rollout |w))) where β is a hyperparameter for controlling the strength of attention-based regularization, and T is an entropy threshold for attentional variance, below which over-attention penalization may be applied to the model.
[0064] Certain embodiments may repeat one or more steps of the method of FIG. 3, where appropriate. Although the present disclosure describes and shows certain steps of the method of FIG. 3 as occurring in a particular order, the present disclosure contemplates any suitable steps of the method of FIG. 3 occurring in any suitable order. Moreover, while the present disclosure describes and shows an exemplary method for analyzing WSI in light of biological context information that includes certain steps of the method of FIG. 3, the present disclosure contemplates any suitable method for analyzing WSI in light of biological context information that includes any suitable steps, which may include all, some, or none of the steps of the method of FIG. 3, where appropriate. Furthermore, although the present disclosure describes and shows certain components, devices, or systems that perform certain steps of the method of FIG. 3, the present disclosure contemplates any suitable combination of any suitable components, devices, or systems that perform any suitable steps of the method of FIG. 3.
[0065] 4A-4J show the effect of semantic self-attention and spatial self-attention, and attention regularization by visualizing the attention map of the ablated model. In particular, when using only the attention-based multiple instance learning method, the model may have false positive attention to non-tumor regions. By adding spatial self-attention, such false positive attention can be reduced.
[0066] Figure 4A shows an example of a whole slide image containing an annotated tumor region a1, marked with a yellow outline, and Figure 4B shows a close-up of the annotated tumor region shown in Figure 4A, as well as a 40x magnification view of individual patches within the annotated tumor region.
[0067] Figure 4C shows an example of an attention map visualization that utilizes an attention-based multiple instance learning technique. The existing attention-based MIL method (AB-MIL) creates a noisy attention map with clear attention to the non-tumor region b1. Figure 4D shows a close-up of the non-tumor region b2 shown in Figure 4C, including both a patch from the WIS (shown on the left) and the corresponding attention map visualization (on the right).
[0068] In contrast to AB-MIL, the transformer-based aggregation model is a semantic self-attention S that allows for improved context for attention. se Thus, noisy attention can be greatly reduced. Figure 4E shows an example of attention map visualization utilizing semantic self-attention techniques. Figure 4F shows a zoomed-in view of the non-tumor region shown in Figure 4E, including both a patch from the WIS (shown on the left) and the corresponding attention map visualization (on the right).
[0069] FIG. 4G shows an example of an attention map visualization that utilizes a semantic self-attention technique enhanced with an entropy-based attention regularizer. att effectively reduces pseudoattention (areas c1->d1 and c2->d3, see red and purple outlines).
[0070] FIG. 4H shows an example of an attention map visualization that utilizes a semantic self-attention technique that is enhanced with a spatial self-attention technique as well as an entropy-based attention regularizer. sp models region-level patterns as context, which may help disambiguate false-positive patches (see green region d->e). Figure 4I shows a comparison between the zoomed-in attention map of Figure 4G and the zoomed-in attention map of Figure 4H for annotated tumor regions. Figure 4J shows a comparison between the zoomed-in attention map of Figure 4G and the zoomed-in attention map of Figure 4H for non-tumor regions.
[0071] This embodiment includes a cross-entropy based attention regularization to avoid the situation where the model relies on only a limited number of patches for prediction. att can be ablated, and the results in Table 2 show that this enhances the model by 6.85% and 3.73% for both datasets in kappa score and C-index, respectively (row #4 vs. #5). Such an enhancement may result in a reduction of model overfitting to false positive patches. To prove, Figure 4C and Figure 4D show the rollout attention of a version of the transformer-based aggregation model with (Figure 4D) and without (Figure 4C) attention regularization. The model is based on Reg att This may result in more distributed attention within the tumor region (see pink areas in Figures 4C and 4D), and therefore reduced false attention to non-tumor regions (see red outlines in Figures 4C and 4D).
[0072] The transformer-based aggregation models are evaluated for two types of downstream tasks: (i) prostate cancer grading on the TCGA-PRAD dataset, and (ii) lung cancer survival prediction on the TCGA-LUSC dataset. The transformer-based aggregation models are first compared with state-of-the-art results, which may be followed by detailed ablation studies on the proposed semantic / spatial self-attention and attention regularization.
[0073] All data were downloaded from The Cancer Genome Atlas (TCGA) and only diagnostic formalin fixed / paraffin embedded (FFPE) slides stained with hematoxylin and eosin (H&E) were used. The TCGA-PRAD dataset consists of prostate adenocarcinoma WSIs collected from 19 different medical centers. Each WSI is annotated with a Gleason score (GS), as an integer ranging from 6 to 10, representing the tumor grade of the sample. A set of 437 WSIs from the TCGA-PRAD dataset was randomly divided into three groups of 243 WSIs, 84 WSIs, and 110 WSIs for training, validation, and testing, respectively. A four-fold cross validation was performed and the average of the results was reported. A quadratic weighted kappa score, κ score, was used to evaluate the results.
[0074] The TCGA-LUSC dataset consists of lung squamous cell carcinoma WSIs. Each WSI is annotated with the observed survival time of the corresponding patient, as well as a value indicating whether the patient died during the observation period. A core dataset of 485 WSIs from UT MD Anderson Cancer Center was split into two groups of 388 WSIs and 97 WSIs for training and testing, respectively, for five-fold cross-validation. As in the survival prediction example, the transformer-based aggregation model outputs a risk score that is correlated with the survival time of the patient. To evaluate the performance of the transformer-based aggregation model, the commonly used concordance index (C-index) was utilized.
[0075] The results of these experiments were compared with state-of-the-art results reported on two datasets. For TCGA-PRAD, examples include (i) TMA supervised, trained on patch-level tissue GP annotations from a tissue microarray dataset; (ii) pseudo patch labeling, trained using slide-level grading as pseudo labels; and (iii) TMA fine-tuning, which pre-trains a model on patch-level tissue GP assertions and fine-tunes it for slide-level grading with MIL. For TCGA-LUSC, examples include MTLSA, GCN, DeepCorrSurv, WSISA, DeepGraphSurv, and RankSurv. Moreover, the embodiments described herein are compared with existing multiple instance learning methods, namely: (i) average pooling, (ii) max pooling, (iii) RNN-based multiple instance learning (RNN-MIL) for modeling cross-patch dependency, (iv) attention-based multiple instance learning (AB-MIL), and (v) dual-stream multiple instance learning (DS-MIL), a transformer-based method for modeling cross-patch dependency, for both datasets.
[0076] Table 1 shows the results obtained for the TCGA-PRAD dataset, measured by weighted kappa scores (κ scores), in the format of mean ± standard. TIFF2024539600000007.tif67170
[0077] Table 1 presents the results for the transformer-based aggregation model compared to the above-mentioned methods for (1) the TCGA-PRAD dataset measured by weighted kappa score (κ score), and (2) the TCGA-LUSC dataset measured by C-index. As shown in Table 1, the results show that the transformer-based aggregation model outperforms the above-mentioned methods by at least 3.67% in κ score for TCGA-PRAD. Compared with TMA fine-tuning, the transformer-based aggregation model achieves superior results without relying on extra tissue pattern learning. Similarly, the transformer-based aggregation model achieves the highest accuracy for TCGA-LUSC. In particular, DeepGraphSurv introduces cross-patch dependency, subject to patch visual features with spectral graph convolution. However, in some cases, DeepGraphSurv may include only a limited number of patches from selected regions of interest, which constrains DeepGraphSurv's ability to capture slide-level patterns, so the transformer-based aggregation model outperforms DeepGraphSurv by 1.64% in C-index.
[0078] Table 2 shows the results obtained from the ablation study of different building blocks on the performance of transformer-based aggregation models (rows #1-5). AB-MIL without self-attention is used as a weak baseline (row #6) and DS-MIL with single-layer limited-connection mutual attention is used as a strong baseline (row #7). Kappa scores and C-indexes are used as measurements on the TCGA-PRAD and TCGA-LUSC datasets. TIFF2024539600000008.tif48170
[0079] Table 2 shows the semantic self-attention SA se We show that,alone,enables an enhancement of 2.63% and 6.61% (rows #2 vs. #6).,On the other hand, spatial self-attention SA sp Adding , enables additional enhancement for both of the two datasets in κ score and C index, respectively (row #2 vs. #5). This proves that the two self-attentions contribute differently to modeling visual context and should both be incorporated. Compared to the strong baseline of DS-MIL, which includes a single-layer semantic self-attention between one predefined patch and another, the deeper and wider semantic attention layer across all patch pairs of the transformer-based aggregation model enables a large enhancement for the TCGA-PRAD dataset (row #5 vs. #7). Moreover, the hierarchical sampling strategy appears to be important for learning spatial self-attention, since disabling the hierarchical sampling strategy results in a performance degradation for both datasets in κ score and C index, respectively (row #3 vs. #5).
[0080] FIG. 5 illustrates an exemplary computer system 500. In certain embodiments, one or more computer systems 500 perform one or more steps of one or more methods described or illustrated herein. In certain embodiments, one or more computer systems 500 provide functionality described or illustrated herein. In certain embodiments, software running on one or more computer systems 500 performs one or more steps of one or more methods described or illustrated herein or provides functionality described or illustrated herein. Certain embodiments include one or more portions of one or more computer systems 500. As used herein, references to a computer system may encompass a computing device, and vice versa, where appropriate. Moreover, references to a computer system may encompass one or more computer systems, where appropriate.
[0081] The present disclosure contemplates any suitable number of computer systems 500. The present disclosure contemplates computer system 500 taking any suitable physical form. By way of example and not limitation, computer system 500 may be an embedded computer system, a system on a chip (SOC), a single board computer system (SBC) (e.g., a computer on module (COM) or system on module (SOM)), a desktop computer system, a laptop or notebook computer system, an interactive kiosk, a mainframe, a mesh of computer systems, a mobile phone, a personal digital assistant (PDA), a server, a tablet computer system, or a combination of two or more of these. Where appropriate, computer system 500 may include one or more computer systems 500, may be single or distributed, may span multiple locations, span multiple machines, span multiple data centers, or may reside in a cloud that may include one or more cloud components in one or more networks. Where appropriate, one or more computer systems 500 may perform one or more steps of one or more methods described or illustrated herein without substantial spatial or temporal limitations. By way of example, and not by way of limitation, the one or more computer systems 500 may perform one or more steps of one or more methods described or shown herein in real time or in batch mode. The one or more computer systems 500 may perform one or more steps of one or more methods described or shown herein at different times or in different locations, where appropriate.
[0082] In a particular embodiment, computer system 500 includes a processor 502, memory 504, storage 506, an input / output (I / O) interface 508, a communications interface 510, and a bus 512. Although this disclosure describes and illustrates a particular computer system having a particular number of particular components in a particular arrangement, this disclosure contemplates any suitable computer system having any suitable number of any suitable components in any suitable arrangement.
[0083] In particular embodiments, the processor 502 includes hardware for executing instructions, such as those that make up a computer program. By way of example and not by way of limitation, to execute instructions, the processor 502 may retrieve (or fetch) instructions from an internal register, an internal cache, memory 504, or storage 506, decode and execute those instructions, and then write one or more results to an internal register, an internal cache, memory 504, or storage 506. In particular embodiments, the processor 502 may include one or more internal caches for data, instructions, or addresses. This disclosure contemplates the processor 502 including any suitable number of any suitable internal caches, where appropriate. By way of example and not by way of limitation, the processor 502 may include one or more instruction caches, one or more data caches, and one or more translation lookaside buffers (TLBs). Instructions in an instruction cache may be copies of instructions in memory 504 or storage 506, and the instruction cache may speed up retrieval of those instructions by the processor 502. The data in the data cache may be a copy of data in memory 504 or storage 506 on which instructions executing in the processor 502 operate, results of previous instructions executed in the processor 502 for access by subsequent instructions executing in the processor 502 or for writing to memory 504 or storage 506, or other suitable data. The data cache may speed up read or write operations by the processor 502. The TLB may speed up virtual-address translation for the processor 502. In particular embodiments, the processor 502 may include one or more internal registers for data, instructions, or addresses. This disclosure contemplates a processor 502 including any suitable number of any suitable internal registers, where appropriate. Where appropriate, the processor 502 may include one or more arithmetic logic units (ALUs), be a multi-core processor, or include one or more processors 502.Although this disclosure describes and illustrates a particular processor, this disclosure contemplates any suitable processor.
[0084] In a particular embodiment, memory 504 includes a main memory for storing instructions for processor 502 to execute or data on which processor 502 operates. By way of example and not by way of limitation, computer system 500 may load instructions into memory 504 from storage 506 or another source (such as, for example, another computer system 500). Processor 502 may then load the instructions from memory 504 into an internal register or cache. To execute instructions, processor 502 may retrieve instructions from the internal register or cache and decode those instructions. During or after execution of instructions, processor 502 may write one or more results (which may be intermediate or final results) to an internal register or cache. Processor 502 may then write one or more of those results to memory 504. In particular embodiments, the processor 502 executes only instructions in one or more internal registers or internal caches or in memory 504 (as opposed to storage 506 or elsewhere) and operates only on data in one or more internal registers or internal caches or in memory 504 (as opposed to storage 506 or elsewhere). One or more memory buses (which may each include an address bus and a data bus) may connect the processor 502 to the memory 504. The bus 512 may include one or more memory buses, as described below. In particular embodiments, one or more memory management units (MMUs) reside between the processor 502 and the memory 504 and facilitate accesses to the memory 504 requested by the processor 502. In particular embodiments, the memory 504 includes random access memory (RAM). The RAM may be volatile memory, where appropriate. The RAM may be dynamic RAM (DRAM) or static RAM (SRAM), where appropriate. Moreover, the RAM may be single-ported RAM or multi-ported RAM, where appropriate. The present disclosure contemplates any suitable RAM. Memory 504 may include one or more memories 504, where appropriate.Although this disclosure describes and illustrates particular memory, this disclosure contemplates any suitable memory.
[0085] In particular embodiments, storage 506 includes mass storage for data or instructions. By way of example and not limitation, storage 506 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive, or a combination of two or more of these. Storage 506 may include removable or non-removable (or fixed) media, as appropriate. Storage 506 may be internal or external to computer system 500, as appropriate. In particular embodiments, storage 506 is a non-volatile solid-state memory. In particular embodiments, storage 506 includes read-only memory (ROM). As appropriate, this ROM may be a mask program ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM), or a flash memory, or a combination of two or more of these. The present disclosure contemplates mass storage 506 taking any suitable physical form. Storage 506 may include one or more storage control units that facilitate communications between processor 502 and storage 506, as appropriate. Storage 506 may include one or more storages 506, as appropriate. Although this disclosure describes and illustrates particular storage, this disclosure contemplates any suitable storage.
[0086] In particular embodiments, I / O interface 508 includes hardware, software, or both that provide one or more interfaces for communication between computer system 500 and one or more I / O devices. Computer system 500 may include one or more of these I / O devices, as appropriate. One or more of these I / O devices may enable communication between a person and computer system 500. By way of example and not by way of limitation, the I / O devices may include a keyboard, a keypad, a microphone, a monitor, a mouse, a printer, a scanner, a speaker, a still camera, a stylus, a tablet, a touch screen, a trackball, a video camera, another suitable I / O device, or a combination of two or more of these. The I / O devices may include one or more sensors. This disclosure contemplates any suitable I / O devices and any suitable I / O interfaces 508 for those I / O devices. As appropriate, I / O interface 508 may include one or more device or software drivers that enable processor 502 to drive one or more of these I / O devices. I / O interface 508 may include one or more I / O interfaces 508, where appropriate. Although this disclosure describes and illustrates a particular I / O interface, this disclosure contemplates any suitable I / O interface.
[0087] In particular embodiments, the communication interface 510 includes hardware, software, or both that provide one or more interfaces for communication (e.g., packet-based communication, etc.) between the computer system 500 and one or more other computer systems 500 or one or more networks. By way of example and not by way of limitation, the communication interface 510 may include a network interface controller (NIC) or network adapter for communicating with an Ethernet or other wire-based network, or a wireless NIC (WNIC) or wireless adapter for communicating with a wireless network, such as a WI-FI network. This disclosure contemplates any suitable network and any suitable communication interface 510 for that network. By way of example and not by way of limitation, the computer system 500 may communicate with one or more portions of an ad-hoc network, a personal area network (PAN), a local area network (LAN), a wide area network (WAN), a metropolitan area network (MAN), or the Internet, or a combination of two or more of these. One or more portions of one or more of these networks may be wired or wireless. As an example, computer system 500 may communicate with a wireless PAN (WPAN) (e.g., such as a BLUETOOTH WPAN), a WI-FI network, a WI-MAX network, a cellular telephone network (e.g., such as a Global System for Mobile Communications (GSM) network), or other suitable wireless networks, or a combination of two or more of these. Computer system 500 may include any suitable communication interface 510 for any of these networks, where appropriate. Communication interface 510 may include one or more communication interfaces 510, where appropriate. Although this disclosure describes and illustrates a particular communication interface, this disclosure contemplates any suitable communication interface.
[0088] In particular embodiments, bus 512 includes hardware, software, or both that connects components of computer system 500 to one another. By way of example, and not by way of limitation, bus 512 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a HyperTransport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a MicroChannel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI Express (PCIe) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local (VLB) bus, or another suitable bus, or a combination of two or more of these. Bus 512 may include one or more buses 512, where appropriate. Although this disclosure describes and illustrates a particular bus, this disclosure contemplates any suitable bus or interconnect.
[0089] As used herein, the one or more computer-readable non-transitory storage media may include, where appropriate, one or more semiconductor-based or other integrated circuits (ICs) (such as, for example, field programmable gate arrays (FPGAs) or application specific ICs (ASICs)), hard disk drives (HDDs), hybrid hard drives (HHDs), optical disks, optical disk drives (ODDs), magneto-optical disks, magneto-optical drives, floppy diskettes, floppy disk drives (FDDs), magnetic tapes, solid state drives (SSDs), RAM drives, secure digital cards or drives, any other suitable computer-readable non-transitory storage media, or any suitable combination of two or more of these. The computer-readable non-transitory storage media may, where appropriate, be volatile, non-volatile, or a combination of volatile and non-volatile.
[0090] As used herein, "or" is inclusive and not exclusive, unless expressly indicated otherwise or indicated otherwise by context. Thus, as used herein, "A or B" means "A, B, or both," unless expressly indicated otherwise or indicated otherwise by context. Moreover, "and" is both jointly and severally, unless expressly indicated otherwise or indicated otherwise by context. Thus, as used herein, "A and B" means "A and B, jointly or severally," unless expressly indicated otherwise or indicated otherwise by context.
[0091] The scope of the present disclosure encompasses all changes, substitutions, variations, alterations, and modifications to the exemplary embodiments described or shown herein that would be understood by a person skilled in the art. The scope of the present disclosure is not limited to the exemplary embodiments described or shown herein. Moreover, although the present disclosure describes and shows each embodiment herein as including certain components, elements, features, functions, operations, or steps, any of these embodiments may include any combination or substitution of any of the components, elements, features, functions, operations, or steps described or shown anywhere herein that would be understood by a person skilled in the art. Furthermore, references in the appended claims to an apparatus or system, or an apparatus or system component, that is adapted, arranged, capable, configured, enabled, operable, or operative to perform a particular function encompass that apparatus, system, component, or particular function thereof, so long as the apparatus, system, or component is so adapted, arranged, capable, configured, enabled, operable, or operative, regardless of whether the apparatus, system, component, or particular function thereof is activated, turned on, or unlocked. Further, while the present disclosure describes or shows certain embodiments as providing certain advantages, a particular embodiment may provide none, some, or all of these advantages.
Claims
1. 1. A computer-implemented method for analyzing whole slide images (WSI) in the context of a biological context, comprising: extracting an embedding for each of a set of sampled patches from a WSI, the embedding representing one or more histological features of each patch of the WSI; for each of the patches, encoding a corresponding embedding with a spatial context and a semantic context, the spatial context representing a local pattern related to the one or more histological features, the local visual pattern spanning regions in the WSI beyond the corresponding patch, and the semantic context representing a global pattern spanning the WSI as a whole; generating a representation for the WSI by combining the encoded patch embeddings; performing a pathology task based on the representation for the WSI; and A method comprising:
2. The method of claim 1 , wherein the patches are sampled by applying a hierarchical sampling strategy to randomly selected clusters of the patches.
3. For each of the randomly selected clusters, randomly sampling the centroids of the clusters; determining, for each of the patches in the cluster, the distance of the patch to the centroid; randomly sampling all patches in the cluster that have a distance to the centroid within a threshold distance; The method of claim 2 , further comprising applying the hierarchical sampling strategy by:
4. The method of claim 3 , wherein the threshold distance is based on the pathology task.
5. 2. The method of claim 1 , wherein encoding the embedding in the spatial context comprises using a spatial encoder to encode the embedding with spatial attention by paying attention to embeddings of one or more nearby patches in the set.
6. The method of claim 5 , wherein the one or more nearby patches are defined as those within a maximum relative distance corresponding to a specified pathological type of the WSI.
7. The method of claim 5 , wherein input for the spatial encoder includes a position of the corresponding patch and a sequence of absolute positions of the nearby patches.
8. The method of claim 7 , wherein the absolute positions are normalized to correspond to a standard level of magnification.
9. 2. The method of claim 1, wherein encoding the embedding in a semantic context of the corresponding patch comprises using a semantic encoder to encode the embedding with semantic attention by paying attention to embeddings of other patches in the set.
10. 10. The method of claim 9, wherein the semantic encoder is a bidirectional self-attention encoder with a multi-head attention layer, wherein the semantic encoder pays attention to the embeddings of the other patches in the set.
11. The method of claim 9 , wherein input for the semantic encoder includes the embeddings of the other patches in the set and learnable tokens.
12. 12. The method of claim 11, wherein during a training phase, generating a representation of the WSI based on the encoded patch embeddings comprises generating an auxiliary representation based on encoded learnable tokens.
13. Enhancing the semantic context by regularizing the semantic attention to reduce overemphasis on some of the patches for generating the representation for the WSI. The method of claim 9 further comprising:
14. Regularizing the semantic attention Computing an attention map over the semantic attention encoded for the embedding corresponding to a patch sampled from the WSI; Adding the negative entropy of the attention map to the training objective of the transformer model; The method of claim 13, comprising:
15. The method of claim 1 , wherein combining the encoded patch embeddings comprises taking an average of the encoded embeddings.
16. performing a pathology task based on the annotations of the WSI; classifying the one or more histological features extracted from the WSI; Classifying the pathological type of said WSI; predicting the risk of disease progression associated with said one or more histological features; or Determining a patient's diagnosis associated with said WSI. The method of claim 1 , comprising:
17. The method of claim 16 , wherein the pathology task can be performed using a classifier model or a regressor model.
18. 18. One or more computer-readable, non-transitory storage media embodying software, the software comprising instructions operable, when executed, to perform the steps recited in any one of claims 1 to 17.
19. 18. A system comprising one or more processors and a memory coupled to said processors and containing instructions executable by said processors, said system being operable, when said processor executes said instructions, to perform the steps of any one of claims 1 to 17.
20. 1. A computer-implemented method for analyzing whole slide images (WSI) in the context of a biological context, comprising: extracting an embedding for each of a set of sampled patches from a WSI, the embedding representing one or more histological features of each patch of the WSI; For each of the patches encoding, with a spatial encoder, the embedding corresponding to the patch with spatial attention by attending to the embeddings of nearby patches in the set, the spatial attention models attention to microscopic visual patterns related to the one or more histological features, the microscopic visual patterns extending beyond the corresponding patch to regions in the WSI; and encoding, by a semantic encoder, the embedding corresponding to the patch with semantic attention by attending to the embeddings of all other patches in the set, where the semantic attention models attention to macroscopic visual patterns across the WSI as a whole; generating a representation for the WSI by combining the encoded patch embeddings; performing a pathology task based on the representation for the WSI; and A method comprising:
Citation Information
Patent Citations
Systems and methods for image preprocessing
WO2020261183A1
