A method for constructing a large pathology model based on self-supervised learning
The construction of a large pathological model through self-supervised learning method solves the problems of data dependence and insufficient generalization ability in traditional technology, achieves high accuracy and adaptability, reduces the labeling workload, enhances the interpretability of the model, and is applicable For the diagnosis of various pathological types and degrees of lesions.
Patent Information
- Application Number
- CN202410163088.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-02-05
AI Technical Summary
Traditional pathology large model technology has strong data dependence, weak generalization ability, poor interpretability, and regulatory and ethical issues, making it difficult to effectively utilize unlabeled massive pathology slice data for intelligent diagnosis.
Using a method based on self-supervised learning, through preprocessing and self-supervised learning of unlabeled pathological slice images, a large residual module pathology model composed of 24 layers of multi-head attention mechanism is constructed, using the multi-head self-attention mechanism and feed-forward neural The network extracts image features and performs pre-training through a self-supervised loss function to reduce dependence on annotated data and improve the model's generalization ability and interpretability.
It improves the accuracy of pathological diagnosis and the generalization ability of the model, reduces the workload of manual annotation, enhances the adaptability and interpretability of the model, reduces the dependence on training data, and is suitable for various pathological types and lesions. and support long-term medical research and applications.
Smart Images

Figure CN118072965B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a method for constructing a large pathology model based on self-supervised learning. Background Art
[0002] Traditional pathology models have limited capacity. Currently, many large Internet companies are actively developing general large model technology and starting to lay out the commercialization path of large models. However, in the medical field, especially in the field of pathology, highly specialized knowledge, massive accumulation of unlabeled pathology slice data, and stable medical resource partnerships make the research and development of pathology large model technology difficult. Therefore, it is necessary to break through the technical barriers of large models in the pathology industry, fill the gap in pathology large model technology, and build a self-supervised learning pathology large model.
[0003] This invention proposes a new method for constructing a pathology big model based on self-supervised learning. The big pathology model constructed by this method can not only intelligently diagnose digital pathology sections of various organs, but also generate anthropomorphic pathology diagnosis reports. The release of this innovative technology will promote the development of the intelligent pathology diagnosis industry and achieve a breakthrough in big model technology in the pathology industry.
[0004] Pathology big model technology is a medical digital pathology slice diagnosis technology based on artificial intelligence. It uses deep learning algorithms to learn a large number of pathology slice images to achieve automatic identification and diagnosis of diseases. The following are the technical solutions and shortcomings of existing pathology big model technology:
[0005] Technical solution:
[0006] 1. Data collection: Collect a large number of pathological slice images, which usually include normal tissues and tissues in various disease states.
[0007] 2. Data preprocessing: Clean, annotate and enhance the collected images to facilitate model learning.
[0008] 3. Model training: Use deep learning algorithms (such as convolutional neural networks) to train the preprocessed images to learn the characteristics of the disease.
[0009] 4. Model validation: Ensure the accuracy and reliability of the model by evaluating its performance on an independent test set.
[0010] 5. Model application: Apply the trained model to actual pathological section image diagnosis to assist doctors in diagnosis.
[0011] Its main disadvantages are as follows:
[0012] 1. Strong data dependence: The performance of pathology large model technology is highly dependent on high-quality labeled data. If the data quality is poor or the amount of labeled data is insufficient, the performance of the model may decline.
[0013] 2. Weak generalization ability: Due to the large differences in pathological slice images, the model may perform poorly on certain specific types of images.
[0014] 3. Poor interpretability: Deep learning models are often viewed as “black boxes” and their decision-making process is difficult to explain, which may affect doctors’ and patients’ trust in the diagnostic results.
[0015] 4. Regulatory and ethical issues: The clinical application of large pathology model technology may involve privacy and data security issues and needs to comply with relevant laws and ethical regulations. Summary of the invention
[0016] One of the purposes of the present invention is to provide a method for constructing a large pathology model based on self-supervised learning. Through self-supervised learning, the model can learn rich pathological features from a large number of unlabeled pathology slice images, thereby improving the accuracy of pathological diagnosis, reducing the workload of manual annotation, adapting to various pathological types and lesion degrees, and improving the generalization ability of the model.
[0017] The present invention provides a method for constructing a large pathology model based on self-supervised learning, comprising:
[0018] Collect digital pathological data of human organs;
[0019] Preprocessing the digital pathology data;
[0020] Based on self-supervised learning, a large pathology model is constructed according to the preprocessing results.
[0021] Preferably, the digital pathological data includes: digital pathological slice images of normal tissues and diseased tissues of human organs.
[0022] Preferably, the preprocessing of the digital pathology data includes:
[0023] Cleaning, annotating, enhancing, removing noise, correcting distortion, and increasing contrast of the digital pathology slice image;
[0024] The layers of the digital pathology slice image of different multiples are read and cut into 320*320 or 512*512 patch data, and a training set, a validation set and a test set are constructed.
[0025] Preferably, before constructing the pathology large model based on self-supervised learning according to the preprocessing results, the method further includes:
[0026] The patch data is stored in a sqlite database.
[0027] Preferably, the self-supervised learning based on the preprocessing results is used to construct a large pathology model, including:
[0028] The backbone network Backbone of the pathology model is composed of 24 layers of residual modules composed of multi-head attention mechanisms. Each attention layer module contains a layer normalization component Norm, a multi-head attention mechanism, a layer normalization component Norm, and a feature integration linear layer MLP component. The feature fusion adopts the addition operator.
[0029] The input image is a 320*320 or 512*512 digital pathology slice image. After a two-dimensional convolution operation, it is cut into n patches and position encoded. Then, each patch is converted into a vector through linear projection of the flat patch, and then the position information is added to each token.
[0030] The first step is image segmentation, which divides the input image into a series of patches, each of which is a square area of a fixed size;
[0031] The second is linear embedding. For each patch, its pixel values are flattened into a one-dimensional vector, and then a linear layer is used to map the one-dimensional vector to a high-dimensional space to obtain the embedded representation of the patch.
[0032] The second step is to add position coding, which is absolute position coding or relative position coding, and is added or concatenated with the embedded representation of the patch;
[0033] Next is the Pathological Large model encoder: the patch sequence with position encoding added is input into the Pathological Large model encoder;
[0034] Next is the classification head. A classification head is added to the output of the Pathological Large Model encoder. It is a fully connected layer used to predict the self-supervisory signal of the image.
[0035] Finally, upstream self-supervised pre-training defines a self-supervised loss function to measure the gap between the model's prediction and the actual label, and then uses an optimization algorithm to minimize this loss function to update the model's parameters.
[0036] Preferably, the size and number of patches can be adjusted according to the specific task and model.
[0037] Preferably, the Pathological Large model encoder consists of multiple layers, each of which contains a multi-head self-attention mechanism and a feed-forward neural network; the multi-head self-attention mechanism allows the pathological large model to simultaneously focus on multiple positions in the sequence, while the feed-forward neural network can perform nonlinear transformations on the features of each position.
[0038] Preferably, the Pathological Large model encoder is Backbone as a universal base; the upstream self-supervised pre-training stage is to perform universal representation learning, which consists of multiple loss functions, including maximizing local information between image blocks, minimizing similarity between features, and sample centering.
[0039] Preferably, a Backbone-based network architecture is used to extract image features.
[0040] Preferably, the self-supervised loss function includes:
[0041]
[0042] student and teachers Architecture Backbone Network and projection head composition: ; The projection head includes a dimensional hidden dimension, followed by a multilayer perceptron (MLP) Normalized and weighted normalized fully connected layer with K dimensions; when represents the temperature softmax result of the student network, Then it is the output probability of temperature softmax of the teacher network; It is to control the sharpness of the output distribution;
[0043] Therefore, the optimization goal is:
[0044]
[0045] in It is the input of the multi-scale cropping strategy, that is, for a given image ,view Contains its two global views and And several smaller resolution partial crops.
[0046] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures particularly pointed out in the written description and the accompanying drawings.
[0047] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0049] Figure 1 Schematic diagram of a method for constructing a large pathology model based on self-supervised learning in an embodiment of the present invention;
[0050] Figure 2 Schematic diagram of a large pathological model in an embodiment of the present invention. DETAILED DESCRIPTION
[0051] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0052] The embodiment of the present invention provides a method for constructing a large pathology model based on self-supervised learning, such as Figure 1 As shown, including:
[0053] Collect digital pathological data of human organs;
[0054] Preprocessing the digital pathology data;
[0055] Based on self-supervised learning, a large pathology model is constructed according to the preprocessing results.
[0056] The digital pathological data include: digital pathological slice images of normal tissues and diseased tissues of human organs.
[0057] The preprocessing of the digital pathology data comprises:
[0058] Cleaning, annotating, enhancing, removing noise, correcting distortion, and increasing contrast of the digital pathology slice image;
[0059] The layers of the digital pathology slice image of different multiples are read and cut into 320*320 or 512*512 patch data, and a training set, a validation set and a test set are constructed.
[0060] The self-supervised learning method, based on the preprocessing results, before constructing the pathology model, also includes:
[0061] The patch data is stored in a sqlite database.
[0062] Based on the self-supervised learning, a pathology model is constructed according to the preprocessing results, including:
[0063] The backbone network Backbone of the pathology model is composed of 24 layers of residual modules composed of multi-head attention mechanisms. Each attention layer module contains a layer normalization component Norm, a multi-head attention mechanism, a layer normalization component Norm, and a feature integration linear layer MLP component. The feature fusion adopts the addition operator.
[0064] The input image is a 320*320 or 512*512 digital pathology slice image. After a two-dimensional convolution operation, it is cut into n patches and position encoded. Then, each patch is converted into a vector through linear projection of the flat patch, and then the position information is added to each token.
[0065] The first step is image segmentation, which divides the input image into a series of patches, each of which is a square area of a fixed size;
[0066] The second is linear embedding. For each patch, its pixel values are flattened into a one-dimensional vector, and then a linear layer is used to map the one-dimensional vector to a high-dimensional space to obtain the embedded representation of the patch.
[0067] The second step is to add position coding, which is absolute position coding or relative position coding, and is added or concatenated with the embedded representation of the patch;
[0068] Next is the Pathological Large model encoder: the patch sequence with position encoding added is input into the Pathological Large model encoder;
[0069] Next is the classification head. A classification head is added to the output of the Pathological Large Model encoder. It is a fully connected layer used to predict the self-supervisory signal of the image.
[0070] Finally, upstream self-supervised pre-training defines a self-supervised loss function to measure the gap between the model's prediction and the actual label, and then uses an optimization algorithm to minimize this loss function to update the model's parameters.
[0071] The size and number of patches can be adjusted according to the specific task and model.
[0072] The Pathological Large Model encoder consists of multiple layers, each of which contains a multi-head self-attention mechanism and a feedforward neural network; the multi-head self-attention mechanism allows the Pathological Large Model to pay attention to multiple positions in the sequence at the same time, while the feedforward neural network can perform nonlinear transformations on the features of each position.
[0073] The Pathological Large Model encoder uses Backbone as a universal base; the upstream self-supervised pre-training stage is for universal representation learning, which consists of multiple loss functions, including maximizing local information between image blocks, minimizing similarity between features, and sample centering.
[0074] Backbone-based network architecture is used to extract image features.
[0075] Self-supervised loss functions include:
[0076]
[0077] student and teachers Architecture Backbone Network and projection head composition: ; The projection head includes a dimensional hidden dimension, followed by a multilayer perceptron (MLP) Normalized and weighted normalized fully connected layer with K dimensions; when represents the temperature softmax result of the student network, Then it is the output probability of temperature softmax of the teacher network; It is to control the sharpness of the output distribution;
[0078] Therefore, the optimization goal is:
[0079]
[0080] in It is the input of the multi-scale cropping strategy, that is, for a given image ,view Contains its two global views and And several smaller resolution partial crops.
[0081] The following is a detailed description of the principles and beneficial effects of a method for constructing a large pathology model based on self-supervised learning. Figure 1As shown:
[0082] Step 1: Digital pathology data collected from dozens of human organs
[0083] Digital pathology data of dozens of human organs are collected, and these images typically include normal tissues and tissues in various disease states.
[0084] Step 2: Data Preprocessing
[0085] Clean, annotate and enhance the collected images to facilitate model learning. This step includes operations such as removing noise, correcting distortion, and increasing contrast. Read different multiples of digital pathology slices and cut them into 320*320 or 512*512 patch data. And build training sets, validation sets, and test sets.
[0086] Step 3: Patch-level data path sqlite storage
[0087] In order to efficiently read data during large model training, large-scale Patch-level data paths are stored in the SQLite database. Model training and optimization are directly read from the memory, which reduces IO and improves GPU utilization.
[0088] Step 4: Establish a 1 billion parameter scale self-supervised learning pathology large model network architecture
[0089] The structure of the backbone network Backbone consists of a 24-layer residual module composed of a multi-head attention mechanism. Each attention layer module contains a layer normalization component Norm, a multi-head attention mechanism, a layer normalization component Norm, and a feature integration linear layer MLP component. The feature fusion uses an addition operator. The input image is a 320*320 or 512*512 slice data. After a two-dimensional convolution operation, it is cut into n patches and position encoded. Then, each block is converted into a vector through Linear Projection of FlattenedPatches, and then position information (position embedding) is added to each token. The first is image segmentation, which divides the input image into a series of patches, each of which is a square area of a fixed size. The size and number of these patches can be adjusted according to the specific task and model. The second is linear embedding. For each patch, its pixel value is flattened into a one-dimensional vector, and then this vector is mapped to a high-dimensional space through a linear layer (also called a projection layer) to obtain the embedded representation of the patch. The next step is to add position encoding. Since the attention-based model itself does not capture the position information in the sequence, position encoding needs to be added to indicate the position of the patch in the image. Position encoding can be absolute position encoding or relative position encoding, which can be added or concatenated with the embedded representation of the patch. Next is the Pathological Large model encoder: the patch sequence with position encoding added is input into the Pathological Large model encoder. The Pathological Large model encoder consists of multiple layers, each of which contains a multi-head self-attention mechanism and a feedforward neural network. The multi-head self-attention mechanism allows the model to pay attention to multiple positions in the sequence at the same time, while the feedforward neural network can perform nonlinear transformations on the features of each position. The next step is the classification head. A classification head is added to the output of the Pathological Large model encoder, usually a fully connected layer, to predict the self-supervisory signal of the image. Finally, there is upstream self-supervised pre-training, which defines a self-supervised loss function to measure the gap between the model's prediction and the actual label, and then uses an optimization algorithm to minimize this loss function to update the model's parameters. The Pathological Large model encoder uses Backbone as a universal base; this stage is for universal representation learning, which is specifically composed of multiple loss functions, including maximizing local information between image blocks, minimizing similarity between features, and sample centering; it enables the model to better understand images.
[0090] Self-supervised loss function
[0091] The self-supervised loss function designed by the present invention is used to guide the model to better capture the characteristics of the data during the learning process, so as to learn useful feature representations without labels. The model is guided to better capture the characteristics of the image during the learning process, improving the performance of the model on various visual tasks. The definition is as follows:
[0092]
[0093] student and teachers Architecture Backbone Network and projection head composition: ; The projection head includes a dimensional hidden dimension, followed by a multilayer perceptron (MLP) Normalized and weighted normalized fully connected layer with K dimensions; when represents the temperature softmax result of the student network, Then it is the output probability of temperature softmax of the teacher network; It is to control the sharpness of the output distribution;
[0094] Therefore, the optimization goal is:
[0095]
[0096] in It is the input of the multi-scale cropping strategy, that is, for a given image ,view Contains its two global views and And several smaller resolution partial crops.
[0097] Technical problems solved by the present invention:
[0098] 1. Data labeling problem: Traditional supervised learning methods require a large amount of labeled data, but in practical applications, obtaining these labeled data often requires a lot of manpower and time. The method proposed in the present invention does not require labeled data, but only unlabeled data, so that a large amount of unlabeled data can be fully utilized to improve the performance of the model.
[0099] 2. Generalization problem: Traditional supervised learning methods may overfit, that is, the model performs well on the training data, but performs poorly on new, unseen data. The method proposed in this invention can improve the generalization ability of the model by learning the intrinsic structure and pattern of the data, so that it can also perform well on new, unseen data.
[0100] 3. Explainability: Deep learning models are usually viewed as “black boxes” and their decision-making process is difficult to explain. The method proposed in this invention can learn the intrinsic structure and pattern of the data, so the explainability of the model will be improved.
[0101] 4. Data dependency and overfitting problems: Traditional supervised learning methods may rely too much on training data, leading to overfitting. The method proposed in the present invention learns the intrinsic structure and pattern of data in an unsupervised manner, which can reduce the dependence on training data and reduce the risk of overfitting.
[0102] Beneficial effects of the present invention:
[0103] 1. Improve the accuracy of pathological diagnosis: Through self-supervised learning, the model can learn rich pathological features from a large number of unlabeled pathological slice images, thereby improving the accuracy of pathological diagnosis.
[0104] 2. Reduce the workload of manual labeling: Traditional supervised learning requires a large amount of manually labeled data, while self-supervised learning can use unlabeled data for learning, greatly reducing the workload of manual labeling.
[0105] 3. Strong adaptability: Since self-supervised learning does not need to rely on specific labels, the model can adapt to various pathological types and degrees of lesions, improving the generalization ability of the model.
[0106] 4. Good scalability: This method can be easily extended to more pathological slice image data, or combined with other medical imaging data, such as CT, MRI, etc., to further improve the performance of the model.
[0107] 5. Favorable for long-term research: Since self-supervised learning can continuously learn from new data, the model can be continuously updated and improved with the development of medicine and the advancement of technology, which is conducive to long-term medical research and application.
[0108] 6. Strong scalability: With the increase of parameter scale, computing power and training data, the model can be continuously improved.
[0109] 7. Strong plasticity of capabilities: further improvement of capabilities can be achieved through fine-tuning of the model.
[0110] Linear Projection of Flattened Patches is a concept in computer vision and deep learning, especially used in the Vision Transformer (ViT) model. This term refers to the process of dividing an image into a series of patches, and then transforming each patch into a fixed-size vector through a linear projection (usually a convolutional layer). This process is also called "Patch Embedding". The purpose of this is to transform the image data into a form suitable for input to the Transformer model, because the Transformer model needs to process sequence data instead of directly processing image data like convolutional neural networks.
[0111] Backbone usually refers to a basic network architecture in computer vision and deep learning, which can be used to extract features of images. These features can be used as input for other tasks, such as object detection, semantic segmentation, etc. Backbone networks are usually pre-trained and reused in many tasks because they have learned common image features. Common Backbone network architectures include VGG, ResNet, Inception, and MobileNet.
[0112] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A method for constructing a large pathology model based on self-supervised learning, characterized in that: include: Collect digital pathological data of human organs; The digital pathological data includes: digital pathological slice images of normal tissues and diseased tissues of human organs; Preprocessing the digital pathology data; Based on self-supervised learning, a large pathology model is constructed according to the preprocessing results; Based on the self-supervised learning, a pathology model is constructed according to the preprocessing results, including: The backbone network Backbone of the pathology model is composed of 24 layers of residual modules composed of multi-head attention mechanisms. Each attention layer module contains a layer normalization component Norm, a multi-head attention mechanism, a layer normalization component Norm, and a feature integration linear layer MLP component. The feature fusion adopts the addition operator. The input image is a 320*320 or 512*512 digital pathology slice image. After a two-dimensional convolution operation, it is cut into n patches and position encoded. Then, each patch is converted into a vector through linear projection of the flat patch, and then the position information is added to each token. The first step is image segmentation, which divides the input image into a series of patches, each of which is a square area of a fixed size; The second is linear embedding. For each patch, its pixel values are flattened into a one-dimensional vector, and then a linear layer is used to map the one-dimensional vector to a high-dimensional space to obtain the embedded representation of the patch. The second step is to add position coding, which is absolute position coding or relative position coding, and is added or concatenated with the embedded representation of the patch; Next is the Pathological Large model encoder: the patch sequence with position encoding added is input into the Pathological Large model encoder; Next is the classification head. A classification head is added to the output of the Pathological Large Model encoder. It is a fully connected layer used to predict the self-supervisory signal of the image. Finally, upstream self-supervised pre-training defines a self-supervised loss function to measure the gap between the model's prediction and the actual label, and then uses an optimization algorithm to minimize this loss function to update the model's parameters; Self-supervised loss functions include: student and teachers The architecture g of each network consists of a backbone network f(ViT) and a projection head h: g = h·f; the projection head includes a multilayer perceptron (MLP) with a d-dimensional hidden dimension, followed by l2-normalization and a weighted normalized fully connected layer with K dimensions; when i = s represents the temperature softmax result of the student network, i = t is the output probability of the temperature softmax of the teacher network; τ i >0 is to control the sharpness of the output distribution; Therefore, the optimization goal is: Where x is the input of the multi-scale cropping strategy, that is, for a given image x, the view V contains its two global views and And several smaller resolution partial crops.
2. A method for constructing a large pathology model based on self-supervised learning as claimed in claim 1, characterized in that: The preprocessing of the digital pathology data comprises: Cleaning, annotating, enhancing, removing noise, correcting distortion, and increasing contrast of the digital pathology slice image; The layers of the digital pathology slice image of different multiples are read and cut into 320*320 or 512*512 patch data, and a training set, a validation set and a test set are constructed.
3. A method for constructing a large pathology model based on self-supervised learning as claimed in claim 2, characterized in that: The self-supervised learning method, based on the preprocessing results, before constructing the pathology model, also includes: The patch data is stored in a sqlite database.
4. A method for constructing a large pathology model based on self-supervised learning as claimed in claim 1, characterized in that: The Pathological Large Model encoder consists of multiple layers, each of which contains a multi-head self-attention mechanism and a feedforward neural network; the multi-head self-attention mechanism allows the Pathological Large Model to pay attention to multiple positions in the sequence at the same time, while the feedforward neural network can perform nonlinear transformations on the features of each position.
5. The method for constructing a large pathology model based on self-supervised learning as claimed in claim 1, characterized in that: Pathological Large model encoder is Backbone as a universal base.
6. A method for constructing a large pathology model based on self-supervised learning as claimed in claim 5, characterized in that: Backbone-based network architecture is used to extract image features.
Citation Information
Patent Citations
New crown infection medical image classification method based on self-supervised learning
CN116664904A
Stomach diagnosis report generation system based on self-supervised joint learning
CN116884561A
