Transformer-based prediction method for EGFR status in whole-slice lung cancer tissue pathology
Through the dynamic adaptive modeling of the visual converter model, the characteristics of the whole-section image of lung cancer tissue pathology are captured, which solves the accuracy and efficiency problems of EGFR status prediction in the whole-section pathology of lung cancer tissue, and achieves more efficient prediction results.
Patent Information
- Application Number
- CN202210385274.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-04-13
AI Technical Summary
It is difficult to accurately predict the EGFR status of whole pathological sections of lung cancer tissue with existing technology, especially due to the complex structure, variable types and rich feature information of pathological images.
A two-stage network based on the visual converter is used to construct a visual converter model to obtain the long-range dependencies within the full-section image of lung cancer tissue pathology, dynamic adaptive modeling, capture local and global features of the image, and achieve accurate prediction of EGFR status.
It improves the prediction accuracy and efficiency of EGFR status in whole pathological sections of lung cancer tissue, reduces the false label error rate, and reduces the pathologist's burden of reading the slides.
Smart Images

Figure CN114820481B
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of computer vision, and in particular to a method for predicting the EGFR status of a whole-slice lung cancer tissue pathology based on a converter. Background Art
[0002] EGFR (Epidermal growth factor receptor) is a transmembrane protein with cytoplasmic kinase activity that can transduce important growth factor signals from the extracellular environment to cells. Lung adenocarcinoma is a common histological type of lung cancer, and the discovery of epidermal growth factor receptor (EGFR) mutations has revolutionized its treatment methods. The positive lung adenocarcinoma EGFR status can be roughly divided into two types: mutant and wild type. In order to ensure the accuracy of the status classification, this patent divides the positive EGFR status other than mutant and wild type into other types (other). In first-line treatment, it is crucial to detect EGFR mutations, because different types of EGFR status will have significant differences in medication and treatment. Therefore, accurately judging the EGFR status plays a vital role in patient treatment and doctor medication.
[0003] Mutation sequencing of biopsy tissue has become the gold standard for detecting EGFR mutations. In the actual diagnosis and treatment process, pathologists need to examine tens of thousands of cells with the naked eye under a microscope. Each pathologist needs to deal with a large number of patient specimens every day, which often leads to film fatigue and misdiagnosis. Therefore, an efficient and quantitative method for predicting the EGFR status of whole-slice lung cancer pathology sections is needed to reduce the reading burden of pathologists and improve the accuracy of predicting the EGFR status of whole-slice lung cancer pathology sections. At present, the algorithms for predicting the EGFR status of whole-slice lung cancer pathology sections are mainly based on supervised learning classification algorithms based on deep learning.
[0004] In recent years, deep learning models have achieved remarkable results in various fields of computer vision. Some researchers have applied convolutional neural networks to the task of predicting the EGFR status of whole-slice lung cancer pathology slices, such as residual networks (ResNet) and dense convolutional networks (Densenet). However, they rely on inductive bias, cannot dynamically and adaptively model, and cannot capture the characteristics of EGFR receptors at the spatial scale, making it difficult to accurately predict the EGFR status of lung cancer. Summary of the invention
[0005] The purpose of the present invention is to make up for the defects of the existing technology and provide a method for predicting the EGFR status of lung cancer tissue pathology whole slices based on a converter, aiming to solve the problem of difficulty in predicting the EGFR status of lung cancer tissue pathology whole slices due to the complex structure of pathology images, variable types, and rich feature information. By constructing a two-stage network based on a visual converter, the internal long-range dependency relationship of the lung cancer tissue pathology whole slice image is obtained, thereby obtaining the corresponding representations of different categories of EGFR receptors, and completing the accurate and efficient prediction of the EGFR status of lung cancer tissue pathology whole slices.
[0006] The present invention is achieved through the following technical solutions:
[0007] A method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter specifically comprises the following steps:
[0008] (1) Obtaining a lung cancer tissue pathology full-slice dataset based on the lung cancer tissue pathology full-slice images and performing preprocessing;
[0009] (2) Establish and use the data set in step (1) to train a visual transformer network model that can predict the yin and yang of image patches;
[0010] (3) using the visual transformer network model capable of predicting the positive and negative nature of image blocks established in step (2) to predict the positive and negative nature of image blocks in the data set, filtering out negative image blocks, and using the retained positive image blocks to generate an EGFR mutation type data set;
[0011] (4) Establishing and using the data set generated in step (3) to train a visual transformer network model capable of predicting the EGFR mutation type of an image block;
[0012] (5) The prediction of the EGFR status of the whole slice is completed by using the visual converter network model capable of predicting the positive and negative nature of the image block established in step (2) and step (4) and the visual converter network model capable of predicting the EGFR mutation type of the image block.
[0013] The step (1) of obtaining a lung cancer tissue pathology full-slice dataset based on the lung cancer tissue pathology full-slice image and performing preprocessing is as follows:
[0014] The whole slice images of lung cancer tissue pathology are sorted according to the positive and negative labels, the blank background area of the whole slice image is removed and divided into blocks, and multiple image blocks are obtained by random sampling, which are recorded as in, represents the i-th image block, C represents the number of channels of the image block, and P×P represents the width and height of each image block; y i represents the i-th image block X iCorresponding to the category, the positive and negative labels of the entire slice are assigned to the image blocks as their pseudo labels, thereby obtaining each image block and its positive and negative classification; i = 1, 2, ..., N; N represents the number of image blocks.
[0015] The step (2) of establishing and using the data set in step (1) to train a visual transformer network model capable of predicting the yin and yang of an image block is as follows:
[0016] Construct a visual transformer ViT consisting of L encoders as the first stage network. Each encoder includes: two normalization layers, a multi-head attention mechanism layer, and a multi-layer perceptron;
[0017] Step 2.1: For image block X i Perform block processing to obtain a sequence of m image blocks in, Represents image block X i The j-th image block; Represents image block X i The width and height of each image block after block processing, and m = P 2 / p 2 ;
[0018] Step 2.2: Set a learnable classification label x class , and use formula (1) to get m image blocks and classification labels x class The D-dimensional embedding representation z l0 , as the input of the first encoder;
[0019]
[0020] In formula (1), E pos Represents m image patches and classification labels x class In image block X i The spatial position in; E represents the set embedding matrix;
[0021] Step 2.3: Use formula (2) to obtain m image blocks and classification labels x class The output z′ of the multi-head attention mechanism layer at the lth encoder l ;
[0022] z' l =MSA(LN(z l-1 ))+z l-1 ,l=1,…,L (2)
[0023] In formula (2), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z l-1 represents the output of the l-1th encoder;
[0024] Step 2.4: Use formula (3) to get the output z of the multilayer perceptron of the lth encoder l ;
[0025] z l =MLP(LN(z′ l ))+z′ l ,l=1,…,L (3)
[0026] In formula (3), MLP(·) represents the processing of multi-layer perceptron; LN(·) represents the processing of normalization layer;
[0027] Step 2.5: Transform the output z of the multilayer perceptron of the lth encoder into l , sent to the multi-head attention mechanism layer of the l+1th encoder to get the output z′ l+1 , and then z′ l+1 The multilayer perceptron sent to the l+1th encoder gets the output z l+1 Repeat step 2.5 multiple times until the Lth encoder, and get the output z of the Lth encoder L ;
[0028] Step 2.6: Use formula (4) to get the normalized output z′ L , and extract the classification label x class The corresponding D-dimensional features
[0029] z′ L =LN(z L ) (4)
[0030] In formula (4), LN(·) represents the processing of the normalization layer;
[0031] Step 2.7: Use formula (5) to perform linear transformation on the features and obtain the output result pos of the linear classifier. pred ;
[0032]
[0033] In formula (5), Linear(·) represents the linear classification function; c stands for negative / positive;
[0034] Step 2.8, construct the cross entropy loss function L using formula (6), and use the gradient descent algorithm to train the first-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the yin and yang of the image block;
[0035]
[0036] In formula (6), y label is the positive or negative pseudo label corresponding to the image block, and N is the total number of image blocks.
[0037] Step (3) uses the visual transformer network model that can predict the positive and negative nature of image blocks established in step (2) to predict the positive and negative nature of image blocks in the data set, screens out negative image blocks, and uses the retained positive image blocks to generate an EGFR mutation type data set, as follows:
[0038] The whole slice images of lung cancer tissue pathology are sorted according to the EGFR mutation status category labels. The blank background area of the whole slice image is removed and divided into blocks. Multiple image blocks are randomly sampled and sent to the trained visual converter network model that can predict the positive and negative nature of the image block. The positive and negative category of each image block is predicted, and the negative image blocks are screened out to obtain n positive image blocks to generate the EGFR mutation type data set, which is recorded as in, represents the i-th image block, C represents the number of channels of the image block, P×P represents the width and height of each image block; y' i Represents image block X' i The corresponding category is the EGFR mutation category label in the dataset; i = 1, 2, …, n; n represents the number of image blocks.
[0039] The step (4) described in establishing and using the data set generated in step (3) to train a visual converter network model capable of predicting the EGFR mutation type of an image block is as follows:
[0040] Construct a visual transformer ViT consisting of S encoders as the second stage network. Each encoder includes: two normalization layers, a multi-head attention mechanism layer, and a multi-layer perceptron;
[0041] Step 4.1: For image block X' i Perform block processing to obtain a sequence containing m' image blocks in, Represents image block X' i The j-th image block; p×p represents the image block X' i The width and height of each image block after block processing, and m'=P 2 / p 2 ;
[0042] Step 4.2: Set a learnable classification label x' class , and use formula (7) to get m image blocks and classification labels x' class The D-dimensional embedding representation z s0, as the input of the first encoder;
[0043]
[0044] In formula (7), E' pos Represents m' image blocks and classification labels x' class In the image block X' i The spatial position in; E' represents the set embedding matrix;
[0045] Step 4.3: Use formula (8) to obtain m' image blocks and classification labels x' class The output z′ of the multi-head attention mechanism layer of the s-th encoder l :
[0046] z′ s =MSA(LN(z s-1 ))+z s-1 ,s=1,…,S (8)
[0047] In formula (8), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z s-1 represents the output of the s-1th encoder;
[0048] Step 4.4: Use equation (9) to get the output z of the multilayer perceptron of the sth encoder: s ;
[0049] z s =MLP(LN(z′ s ))+z′ s ,s=1,…,S (9)
[0050] In formula (9), MLP(·) represents the processing of multi-layer perceptron; LN(·) represents the processing of normalization layer;
[0051] Step 4.5: Transform the output z of the multilayer perceptron of the sth encoder into s , sent to the multi-head attention mechanism layer of the s+1th encoder to get the output z′ s+1 , and then z′ s+1 The multilayer perceptron sent to the s+1th encoder gets the output z s+1 Repeat step 4.5 multiple times until the Sth encoder, and get the output z of the Sth encoder S ;
[0052] Step 4.6: Use formula (10) to get the normalized output z′ S , and extract the classification label x' class The corresponding D-dimensional features
[0053] z′ S =LN(z S ) (10)
[0054] In formula (10), LN(·) represents the processing of the normalization layer;
[0055] Step 4.7: Use formula (11) to perform linear transformation on the features and obtain the output result of the linear classifier egfr pred :
[0056]
[0057] In formula (11), Linear(·) represents the linear classification function; c represents the number of EGFR status categories;
[0058] Step 4.8: Use formula (12) to construct the cross entropy loss function L, and use the gradient descent algorithm to train the second-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the EGFR mutation type of the image block:
[0059]
[0060] In formula (12), y label is the EGFR status pseudo label of the image block, and N is the total number of image blocks.
[0061] Step (5) uses the visual converter network model capable of predicting the positive and negative nature of the image block established in step (2) and step (4) and the visual converter network model capable of predicting the EGFR mutation type of the image block to complete the prediction of the EGFR status of the whole slice, as follows:
[0062] Step 5.1: Remove the blank background area from the whole slice image of lung cancer tissue pathology and divide it into blocks to obtain multiple image blocks, which are recorded as a sequence (x1, x2, ..., x j ,…,x m );
[0063] Step 5.2: Transform the image block (x1, x2, …, x j ,…,x m ) is sent to the visual transformer network model capable of predicting the yin and yang of the image block, the yin and yang category of the image block is predicted, the negative image blocks are screened out, and the positive image block sequence (x1, x2, ..., x j ,…,x n ) ; Set the positive and negative classification threshold t, and calculate the positive image block proportion t according to formula (13) pos, compare the classification threshold t and the positive image block ratio t pos Determine the positive-negative classification of whole sections;
[0064]
[0065] Step 5.3: For the whole slice predicted as positive in step 5.2, the next prediction is performed; the positive image blocks (x1, x2, ..., x j ,…,x n ) Input the visual converter network model capable of predicting the EGFR mutation type of the image block, predict the EGFR mutation type corresponding to each image block, and calculate the proportion of each EGFR state in n image blocks according to formula (14): i , the category with the highest proportion is the EGFR status of the whole section of lung cancer tissue pathology, where n i is the number of image blocks corresponding to the i-th type of EGFR mutation status, and K is the classification of all EGFR mutation status;
[0066]
[0067] The advantages of the present invention are:
[0068] 1. The present invention uses a visual converter to learn features of lung cancer tissue pathology full-slice images. The visual converter can dynamically and adaptively model and capture local and global features of the image based on the attention mechanism, thereby improving the feature representation capability of lung cancer tissue pathology full-slice images.
[0069] 2. The present invention utilizes visual converters to learn long-range dependencies within images, thereby establishing dependencies between various parts of full-slice images of lung cancer tissue pathology, thereby improving the accuracy of EGFR status prediction.
[0070] 3. The present invention uses two visual converter ViT models to form a backbone network. The first visual converter completes the positive-negative classification of the whole slice image of lung cancer tissue pathology and extracts the positive image blocks. The second visual converter only classifies the positive image blocks into EGFR types, effectively reducing the error rate of pseudo-labels and improving the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] Figure 1 is a structural diagram of the network in the present invention;
[0072] Figure 2 It is the overall flow chart of the present invention. DETAILED DESCRIPTION
[0073] In this embodiment, a method for predicting the EGFR status of a whole slice of lung cancer tissue pathology based on a converter comprehensively considers the difficulty of the EGFR status classification task, so the image is first input into the first visual converter network to predict the positive and negative classification of the whole slice image, and the positive image block is input into the second visual converter network to predict the EGFR status of each image block, thereby completing the classification of the EGFR status of the whole slice image of lung cancer tissue pathology, such as Figure 1 , 2 As shown, the specific steps are as follows:
[0074] Step (1), obtaining a lung cancer tissue pathology full-slice dataset based on the lung cancer tissue pathology full-slice image and performing preprocessing, specifically as follows:
[0075] The whole slice images of lung cancer tissue pathology are sorted according to the positive and negative labels, the blank background area of the whole slice image is removed and divided into blocks, and multiple image blocks are obtained by random sampling, which are recorded as in, represents the i-th image block, C represents the number of channels of the image block, and P×P represents the width and height of each image block; y i represents the i-th image block X i Corresponding categories, the positive and negative labels of the whole slice are assigned to the image blocks as their pseudo labels, so as to obtain each image block and its positive and negative classification; i = 1, 2, ..., N; N represents the number of image blocks; the data EGFR status used in this embodiment includes two categories: negative and positive; the data set contains 100 whole slices, and 500 image blocks are randomly sampled on each whole slice, so N = 500, and the size of each image block is 256 × 256, so C = 3, P = 256; 80% of each category in the data set is used for training, and the remaining 20% is used for testing.
[0076] Step (2): Establish and use the data set in step (1) to train a visual transformer network model that can predict the yin and yang of an image patch, as follows:
[0077] Establish as Figure 1 The deep learning network model based on the visual converter is shown in the figure. The deep learning network includes two visual converter ViT networks. The visual converter ViT consisting of L encoders is constructed as the first stage network. Each encoder includes: two normalization layers, a multi-head attention mechanism layer, and a multi-layer perceptron.
[0078] Step 2.1: For image block X i Perform block processing to obtain a sequence of m image blocks in, Represents image block X i The j-th image block; Represents image block Xi The width and height of each image block after block processing, and m = P 2 / p 2 ; In this embodiment, the size of each image block is 16×16, so p=16 and m=196.
[0079] Step 2.2: Set a learnable classification label x class , and use formula (1) to get m image blocks and classification labels x class The D-dimensional embedding representation z l0 , as the input of the first encoder;
[0080]
[0081] In formula (1), E pos Represents m image patches and classification labels x class In image block X i The spatial position in the matrix; E represents the embedded matrix set; in this embodiment, D = 768, x class is a 768-dimensional vector consisting of 768 random numbers, E is a 768×768 matrix consisting of 768 rows and 768 columns. pos It is a matrix of 197×768 random numbers, with 197 rows and 768 columns.
[0082] Step 2.3: Use formula (2) to obtain m image blocks and classification labels x class The output z′ of the multi-head attention mechanism layer at the lth encoder l :
[0083] z' l =MSA(LN(z l-1 ))+z l-1 ,l=1,…,L (2)
[0084] In formula (2), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z l-1 represents the output of the l-1th encoder;
[0085] Step 2.4: Use formula (3) to get the output z of the multilayer perceptron of the lth encoder l ;
[0086] z l =MLP(LN(z′ l ))+z′ l ,l=1,…,L (3)
[0087] In formula (3), MLP(·) represents the processing of the multilayer perceptron. In this embodiment, the multilayer perceptron includes two layers of networks and a GELU nonlinear activation layer; LN(·) represents the processing of the normalization layer;
[0088] Step 2.5: Transform the output z of the multilayer perceptron of the lth encoder into l , sent to the multi-head attention mechanism layer of the l+1th encoder to get the output z′ l+1 , and then z′ l+1 The multilayer perceptron sent to the l+1th encoder gets the output z l+1 Repeat step 2.5 multiple times until the Lth encoder, and get the output z of the Lth encoder L .
[0089] Step 2.6: Use formula (4) to get the normalized output z′ L , and extract the classification label x class The corresponding D-dimensional features
[0090] z′ L =LN(z L ) (4)
[0091] In formula (4), LN(·) represents the processing of the normalization layer;
[0092] Step 2.7: Use formula (5) to perform linear transformation on the features and obtain the output result pos of the linear classifier. pred :
[0093]
[0094] In formula (5), Linear(·) represents the linear classification function; c stands for negative / positive;
[0095] Step 2.8: Use formula (6) to construct the cross entropy loss function L, and use the gradient descent algorithm to train the first-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the yin and yang of the image block:
[0096]
[0097] In formula (6), y label is the positive or negative pseudo label corresponding to the image block, and N is the total number of image blocks.
[0098] Step (3), using the visual transformer network model capable of predicting the positive and negative nature of image blocks established in step (2) to predict the positive and negative nature of image blocks in the data set, filtering out negative image blocks, and using the retained positive image blocks to generate an EGFR mutation type data set, as follows:
[0099] The whole slice images of lung cancer tissue pathology are sorted according to the EGFR mutation status category labels. The blank background area of the whole slice image is removed and divided into blocks. Multiple image blocks are randomly sampled and sent to the visual converter network model that can predict the positive and negative nature of the image blocks trained in step 2. The positive and negative categories of each image block are predicted, and the negative image blocks are screened out to obtain n positive image blocks. The EGFR mutation type dataset is generated, which is recorded as in, represents the i-th image block, C represents the number of channels of the image block, P×P represents the width and height of each image block; y' i Represents image block X' i The corresponding category is the EGFR mutation category label in the data set; i = 1, 2, ..., n; n represents the number of image blocks; the EGFR mutation status data used in this embodiment includes three categories: Mutant, Wild and Other; the data set contains 100 full slices, 500 image blocks are randomly sampled on each full slice, and the size of each image block is 256 × 256, so C = 3, P = 256; 80% of each category in the data set is used for training, and the remaining 20% is used for testing.
[0100] Step (4): Establish and use the data set generated in step (3) to train a visual converter network model that can predict the EGFR mutation type of an image block, as follows:
[0101] Construct a visual transformer ViT consisting of S encoders as the second stage network. Each encoder includes: two normalization layers, a multi-head attention mechanism layer, and a multi-layer perceptron;
[0102] Step 4.1: For image block X' i Perform block processing to obtain a sequence containing m' image blocks in, Represents image block X' i The j-th image block; p×p represents the image block X i The width and height of each image block after block processing, and m'=P 2 / p 2 ; In this embodiment, the size of each image block is 16×16, so p=16, and m'=196.
[0103] Step 4.2: Set a learnable classification label x'class , and use formula (7) to get m image blocks and classification labels x' class The D-dimensional embedding representation z s0 , as the input of the first encoder;
[0104]
[0105] In formula (7), E' pos Represents m' image blocks and classification labels x' class In the image block X' i The spatial position in; E' represents the embedded matrix set; in this embodiment, D = 768, x' class is a 768-dimensional vector consisting of 768 random numbers, E' is a 768×768 matrix consisting of 768 rows and 768 columns. pos It is a matrix of 197×768 random numbers, with 197 rows and 768 columns.
[0106] Step 4.3: Use formula (8) to obtain m' image blocks and classification labels x' class The output z′ of the multi-head attention mechanism layer of the s-th encoder l :
[0107] z′ s =MSA(LN(z s-1 ))+z s-1 ,s=1,…,S (8)
[0108] In formula (8), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z s-1 represents the output of the s-1th encoder;
[0109] Step 4.4: Use equation (9) to get the output z of the multilayer perceptron of the sth encoder: s :
[0110] z s =MLP(LN(z′ s ))+z′ s ,s=1,…,S (9)
[0111] In formula (9), MLP(·) represents the processing of the multilayer perceptron. In this embodiment, the multilayer perceptron includes two layers of networks and a GELU nonlinear activation layer; LN(·) represents the processing of the normalization layer;
[0112] Step 4.5: Transform the output z of the multilayer perceptron of the sth encoder into s, sent to the multi-head attention mechanism layer of the s+1th encoder to get the output z′ s+1 , and then z′ s+1 The multilayer perceptron sent to the s+1th encoder gets the output z s+1 Repeat step 4.5 multiple times until the Sth encoder, and get the output z of the Sth encoder S .
[0113] Step 4.6: Use formula (10) to get the normalized output z′ S , and extract the classification label x' class The corresponding D-dimensional features
[0114] z′ S =LN(z S ) (10)
[0115] In formula (10), LN(·) represents the processing of the normalization layer;
[0116] Step 4.7: Use formula (11) to perform linear transformation on the features and obtain the output result of the linear classifier egfr pred :
[0117]
[0118] In formula (11), Linear(·) represents the linear classification function; c represents the number of EGFR status categories;
[0119] Step 4.8: Use formula (12) to construct the cross entropy loss function L, and use the gradient descent algorithm to train the second-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the EGFR mutation type of the image block:
[0120]
[0121] In formula (12), y label is the EGFR status pseudo label of the image block, and N is the total number of image blocks.
[0122] Step (5), using the visual converter network model capable of predicting the positive and negative nature of the image block established in step (2) and step (4) and the visual converter network model capable of predicting the EGFR mutation type of the image block to complete the prediction of the EGFR status of the whole slice, as follows:
[0123] Step 5.1: Remove the blank background area from the whole slice image of lung cancer tissue pathology and divide it into blocks to obtain multiple image blocks, which are recorded as a sequence (x1, x2, ..., xj ,…,x m );
[0124] Step 5.2: Transform the image block (x1, x2, …, x j ,…,x m ) is sent to the visual transformer network model that can predict the yin and yang of the image block, predict the yin and yang category of the image block, filter out the negative image blocks, and obtain the positive image block sequence (x1, x2, …, x j ,…,x n ) ; Set the positive and negative classification threshold t, and calculate the positive image block proportion t according to formula (13) pos , compare the classification threshold t and the positive image block ratio t pos Determine the positive-negative classification of whole sections;
[0125]
[0126] Step 5.3: For the whole slice predicted as positive in step 5.2, the next prediction is performed; the positive image blocks (x1, x2, ..., x j ,…,x n ) Input the visual transformer network model that can predict the EGFR mutation type of the image block, predict the EGFR mutation type corresponding to each image block, and calculate the proportion of each EGFR state in n image blocks according to formula (14): i , the category with the highest proportion is the EGFR status of the whole section of lung cancer tissue pathology, where n i is the number of image blocks corresponding to the i-th type of EGFR mutation state, and K is all EGFR mutation state classifications; in this embodiment, K=3.
[0127]
Claims
1. A method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter, characterized in that: The specific steps include: (1) Obtaining a lung cancer tissue pathology full-slice dataset based on the lung cancer tissue pathology full-slice images and performing preprocessing; (2) Establish and use the data set in step (1) to train a visual transformer network model that can predict the yin and yang of image patches; (3) using the visual transformer network model capable of predicting the positive and negative nature of image blocks established in step (2) to predict the positive and negative nature of image blocks in the data set, filtering out negative image blocks, and using the retained positive image blocks to generate an EGFR mutation type data set; (4) Establishing and using the data set generated in step (3) to train a visual transformer network model capable of predicting the EGFR mutation type of an image block; (5) using the visual converter network model capable of predicting the positive and negative nature of an image block established in step (2) and step (4) and the visual converter network model capable of predicting the EGFR mutation type of an image block to complete the prediction of the EGFR status of the whole slice; Step (5) uses the visual converter network model capable of predicting the positive and negative nature of an image block established in step (2) and step (4) and the visual converter network model capable of predicting the EGFR mutation type of an image block to complete the prediction of the EGFR status of the whole slice, as follows: Step 5.1: Remove the blank background area from the whole slice image of lung cancer tissue pathology and divide it into blocks to obtain multiple image blocks, which are recorded as a sequence (x1, x2, ..., x j ,…,x m ); Step 5.2: Transform the image block (x1, x2, …, x j ,…,x m ) is sent to the visual transformer network model capable of predicting the yin and yang of the image block, the yin and yang category of the image block is predicted, the negative image blocks are screened out, and the positive image block sequence (x1, x2, ..., x j ,…,x n ) ; Set the positive and negative classification threshold t, and calculate the positive image block proportion t according to formula (13) pos , compare the classification threshold t and the positive image block ratio t pos Determine the positive-negative classification of whole sections; Step 5.3: perform the next step prediction for the whole slice predicted as positive in step 5.2; The positive image blocks of the whole slice (x1, x2, ..., x j ,…,x n ) Input the visual converter network model capable of predicting the EGFR mutation type of the image block, predict the EGFR mutation type corresponding to each image block, and calculate the proportion of each EGFR state in n image blocks according to formula (14): i , the category with the highest proportion is the EGFR status of the whole section of lung cancer tissue pathology, where n i is the number of image blocks corresponding to the i-th type of EGFR mutation status, and K is the classification of all EGFR mutation status; 2. The method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter according to claim 1, characterized in that: The step (1) of obtaining a lung cancer tissue pathology full-slice dataset based on the lung cancer tissue pathology full-slice image and performing preprocessing is as follows: The whole slice images of lung cancer tissue pathology are sorted according to the positive and negative labels, the blank background area of the whole slice image is removed and divided into blocks, and multiple image blocks are obtained by random sampling, which are recorded as Among them, X i ∈R C×P×P represents the i-th image block, C represents the number of channels of the image block, and P×P represents the width and height of each image block; y i represents the i-th image block X i Corresponding to the category, the positive and negative labels of the entire slice are assigned to the image blocks as their pseudo labels, thereby obtaining each image block and its positive and negative classification; i = 1, 2, ..., N; N represents the number of image blocks.
3. The method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter according to claim 2, characterized in that: The step (2) of establishing and using the data set in step (1) to train a visual transformer network model capable of predicting the yin and yang of an image block is as follows: Construct a visual transformer ViT consisting of L encoders as the first stage network, each encoder includes: two normalization layers, a multi-head attention mechanism layer and a multi-layer perceptron; Step 2.1: For image block X i Perform block processing to obtain a sequence of m image blocks in, Represents image block X i The j-th image block; p×p represents the image block X i The width and height of each image block after block processing, and m = P 2 / p 2 ; Step 2.2: Set a learnable classification label x class , and use formula (1) to get m image blocks and classification labels x class The D-dimensional embedding representation z l0 , as the input of the first encoder; In formula (1), E pos Represents m image patches and classification labels x class In image block X i The spatial position in; E represents the set embedding matrix; Step 2.3: Use formula (2) to obtain m image blocks and classification labels x class The output z of the multi-head attention mechanism layer at the lth encoder l ′; z' l =MSA(LN(z l-1 ))+z l-1 ,l=1,…,L (2) In formula (2), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z l-1 represents the output of the l-1th encoder; Step 2.4: Use formula (3) to get the output z of the multilayer perceptron of the lth encoder l ; With l =MLP(LN(z l ′))+z l ′,l=1,…,L (3) In formula (3), MLP(·) represents the processing of multi-layer perceptron; LN(·) represents the processing of normalization layer; Step 2.5: Transform the output z of the multilayer perceptron of the lth encoder into l , sent to the multi-head attention mechanism layer of the l+1th encoder to get the output z l ' +1 , and then z l ' +1 The multilayer perceptron sent to the l+1th encoder gets the output z l+1 Repeat step 2.5 multiple times until the Lth encoder, and get the output z of the Lth encoder L ; Step 2.6: Use formula (4) to get the normalized output z′ L , and extract the classification label x class The corresponding D-dimensional features With' L =LN(from L ) (4) In formula (4), LN(·) represents the processing of the normalization layer; Step 2.7: Use formula (5) to perform linear transformation on the features and obtain the output result pos of the linear classifier. pred ; In formula (5), Linear(·) represents the linear classification function; pos pred ∈R c ; c represents negative / positive; Step 2.8, construct the cross entropy loss function L using formula (6), and use the gradient descent algorithm to train the first-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the yin and yang of the image block; In formula (6), y label is the positive or negative pseudo label corresponding to the image block, and N is the total number of image blocks.
4. The method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter according to claim 3, characterized in that: Step (3) uses the visual transformer network model that can predict the positive and negative nature of image blocks established in step (2) to predict the positive and negative nature of image blocks in the data set, screens out negative image blocks, and uses the retained positive image blocks to generate an EGFR mutation type data set, as follows: The whole slice images of lung cancer tissue pathology are sorted according to the EGFR mutation status category labels. The blank background area of the whole slice image is removed and divided into blocks. Multiple image blocks are randomly sampled and sent to the trained visual converter network model that can predict the positive and negative nature of the image block. The positive and negative category of each image block is predicted, and the negative image blocks are screened out to obtain n positive image blocks to generate the EGFR mutation type data set, which is recorded as Among them, X' i ∈R C×P×P represents the i-th image block, C represents the number of channels of the image block, P×P represents the width and height of each image block; y' i Represents image block X' i The corresponding category is the EGFR mutation category label in the dataset; i = 1, 2, …, n; n represents the number of image blocks.
5. The method for predicting EGFR status of whole-slice lung cancer tissue pathology based on a converter according to claim 4, characterized in that: Step (4) establishes and uses the data set generated in step (3) to train a visual converter network model capable of predicting the EGFR mutation type of an image block, as follows: Construct a visual transformer ViT consisting of S encoders as the second stage network. Each encoder includes: two normalization layers, a multi-head attention mechanism layer, and a multi-layer perceptron; Step 4.1: For image block X' i Perform block processing to obtain a sequence containing m' image blocks in, Represents image block X' i The j-th image block; p×p represents the image block X' i The width and height of each image block after block processing, and m'=P 2 / p 2 ; Step 4.2: Set a learnable classification label x' class , and use formula (7) to get m image blocks and classification labels x' class The D-dimensional embedding representation z s0 , as the input of the first encoder; In formula (7), E' pos Represents m' image blocks and classification labels x' class In the image block X' i The spatial position in; E' represents the set embedding matrix; Step 4.3: Use formula (8) to obtain m' image blocks and classification labels x' class The output z of the multi-head attention mechanism layer of the s-th encoder l ′: z s ′=MSA(LN(z s-1 ))+z s-1 ,s=1,…,S (8) In formula (8), MSA(·) represents the processing of the multi-head self-attention mechanism layer; LN(·) represents the processing of the normalization layer; z s-1 represents the output of the s-1th encoder; Step 4.4: Use equation (9) to get the output z of the multilayer perceptron of the sth encoder: s ; With s =MLP(LN(z s ′))+z s ′,s=1,…,S (9) In formula (9), MLP(·) represents the processing of multi-layer perceptron; LN(·) represents the processing of normalization layer; Step 4.5: Transform the output z of the multilayer perceptron of the sth encoder into s , sent to the multi-head attention mechanism layer of the s+1th encoder to get the output z s ' +1 , and then z s ' +1 The multilayer perceptron sent to the s+1th encoder gets the output z s+1 Repeat step 4.5 multiple times until the Sth encoder, and get the output z of the Sth encoder S ; Step 4.6: Use formula (10) to get the normalized output z′ S , and extract the classification label x' class The corresponding D-dimensional features With' S =LN(from S ) (10) In formula (10), LN(·) represents the processing of the normalization layer; Step 4.7: Use formula (11) to perform linear transformation on the features and obtain the output result of the linear classifier egfr pred : In formula (11), Linear(·) represents the linear classification function; egfr pred ∈R c ; c represents the number of EGFR status categories; Step 4.8: Use formula (12) to construct the cross entropy loss function L, and use the gradient descent algorithm to train the second-stage network composed of the visual converter and the linear classifier, so that the cross entropy loss function L converges, thereby obtaining a trained visual converter network model that can predict the EGFR mutation type of the image block: In formula (12), y label is the EGFR status pseudo label of the image block, and N is the total number of image blocks.
