Full-view digital slide image classification modeling method and device based on integrated deep learning

By using the integrated deep learning method in full-field digital slice image classification, filtering tiles in the target area and combining the pre-training of multiple sub-classifiers and the Majority Voting integration strategy, the problems of low accuracy and difficult feature fusion of a single model are solved, improving improve the accuracy and robustness of image classification.

CN115239613BActive Publication Date: 2024-08-23KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210149217.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-18
Publication Date
2024-08-23
Estimated Expiration
2042-02-18

AI Technical Summary

Technical Problem

In the existing technology, in the classification of full-field digital slice images, a single model results in low accuracy and poor generalization. Moreover, due to the large amount of image information, feature fusion is difficult and the model is difficult to converge.

Method used

Using a method based on integrated deep learning, the target area recognition model is trained through the collected and labeled target area and non-target area tiles, and the tiles containing the target area are screened out, and multiple sub-classifiers (such as ResNet, MobileNetV3, EfficientNetV2) are used for prediction. Training and verification, combined with the Majority Voting integration strategy to fuse the prediction results.

Benefits of technology

It improves the accuracy, robustness and interpretability of the model, reduces the training complexity and improves the prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115239613B
    Figure CN115239613B
Patent Text Reader

Abstract

The present invention discloses a full-view digital slice image classification modeling method and device based on integrated deep learning. The present invention trains a high-accuracy target area recognition model through pre-collected target area and non-target area tiles annotated by experts, which is used to screen all tiles of each WSI and only extract tiles containing target areas, thereby greatly reducing the complexity of training and improving training efficiency. In addition, the idea of ​​integrated learning is introduced to construct three different classification networks that meet diversity conditions, and finally an integrated strategy is adopted to fuse the sub-classifier results to reduce the complexity of the problem and improve the model robustness, interpretability and prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a full-view digital slice image classification modeling method and device based on integrated deep learning, belonging to the fields of computer vision and medical data analysis and mining. Background Art

[0002] In recent years, with the development of machine learning (ML), especially deep learning (DL) technology, various prognostic models have been proposed one after another. At present, existing studies mostly analyze and mine through CT, MRI and other images to establish prognostic models. With the development and promotion of scanning technology, especially full-view digital slice (WSI) technology, WSI has been widely used in the field of medical pathology. WSI is a digital slice with a full field of view obtained by scanning and seamlessly splicing traditional glass slices; WSI has the functions of traditional slices both in the medical field and in teaching and research practice, and is not restricted by time and space; WSI contains all the lesion information on the glass slice, which is not a static picture. It can be observed at different magnifications (4 times, 10 times, 20 times, 40 times, etc.) on the computer like under a microscope, and can be browsed in a certain range with stepless continuous zoom. In the medical field, experts can combine WSI to conduct prognostic analysis on patients. However, WSI is often characterized by rich diversity, high complexity, and large amount of information, which results in low consistency in the visual analysis results of WSI by radiologists and low analysis efficiency.

[0003] The role of DL in the construction of image classification models is mainly feature extraction and feature selection. The modeling steps can be summarized as follows: ① Determine a specific classification target (local recurrence, distant metastasis, survival risk, adjuvant chemotherapy effect, etc.). ② Data collection and data preprocessing. ③ Divide the preprocessed data into non-overlapping training sets, validation sets, and test sets. ④ The training set trains the model to determine the model parameters, and the validation set optimizes the network structure and hyperparameters to determine the optimal model. ⑤ The test set tests the model performance. Conventional prediction methods use a single model, resulting in low model accuracy and poor generalization.

[0004] Furthermore, since a single WSI contains too much information, each image may have tens of thousands or even more tiles after segmentation, which can easily lead to information redundancy, difficulty in feature fusion, and difficulty in model convergence. Therefore, in order to solve the above problems. Summary of the invention

[0005] The present invention provides a full-field digital slice image classification modeling method and device based on integrated deep learning, which are used to obtain a classification model of the full-field digital slice image.

[0006] The technical solution of the present invention is: a full-view digital slice image classification modeling method based on integrated deep learning, comprising:

[0007] S1. Collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked;

[0008] S2. Divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI;

[0009] S3, preprocessing the digital image slice tile obtained after the segmentation in S2 to obtain the preprocessed digital image slice tile;

[0010] S4, training a target area tile recognition model for the labeled digital image slice tiles collected in S1;

[0011] S5, inputting the digital image slice tiles preprocessed by S3 into the target area tile recognition model trained in S4, and selecting a group of digital image slice tiles that only contain the target area;

[0012] S6, for a set of digital image slices tile containing only the target area obtained in S5, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ;

[0013] S7, select multiple sub-classifiers, first use the pre-training training set D obtained in S6 trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters;

[0014] S8, training set D after processing S5 trnMultiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in S7. Then, the MajorityVoting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results and obtain the final integrated prediction results. Then, the validation set D processed by S5 is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test The performance of the classification model was tested and finally an image classification model was obtained.

[0015] In S2, each full-view digital slice image WSI is subjected to a sliding window segmentation process, including: obtaining the total number of pyramid layers of the original full-view digital slice image WSI and the size of the target segmentation layer, and then calculating the number of window sliding times according to the set window size to segment the full-view digital slice image WSI of the selected target segmentation layer.

[0016] In S2, each full-view digital slice image WSI is subjected to a sliding window segmentation process, including:

[0017] S2.1. For the original full-view digital slice image WSI, first obtain its total pyramid layer number, assuming it is L all Layer, select L all -1 layer is used as the target segmentation layer, and the sizes w and h of the target segmentation layer are obtained; where w is the width of the target segmentation layer, and h is the length of the target segmentation layer;

[0018] S2.2. Calculate the number of window sliding times based on the size of the target slice layer obtained:

[0019]

[0020] In formula (1), win w Indicates the window width, N w The number of times the window slides horizontally, and is rounded down;

[0021]

[0022] In formula (2), win h Indicates the window length, N h The number of vertical sliding times of the window, rounded down;

[0023] S2.3. According to the calculated number of horizontal and vertical sliding of the window, the full-view digital slice image WSI of the target slice layer is segmented by a sliding window, and each tile is written out and saved.

[0024] The preprocessing in S3 includes staining normalization, size normalization and blank screening.

[0025] The target area tile recognition model construction process in S4 is as follows:

[0026] S4.1. First, the labeled digital image tiles collected in S1 are divided into the recognition model training set D labeltrn , identification model validation set D labelval And recognition model test set D labeltest ;

[0027] S4.2. Select Pytorch as the deep learning framework and train the recognition model on the training set D labeltrn The images are resized, horizontally flipped, and grayed. labelval The images of only size unification operation, recognition model test set D labeltest The operation is the same as identifying the model validation set;

[0028] S4.3. Select the residual neural network ResNet as the modeling network of the labeled area tile recognition model, and use the recognition model training set D labeltrn and recognition model validation set D labelval The residual neural network ResNet is trained and verified, and the training parameters of each batch are saved to finally obtain the evaluation index results of classification accuracy, sensitivity, and specificity; according to the evaluation index results of the recognition model verification set, the batch of parameters with the best performance is selected as the final parameters, and the recognition model test set D is used to labeltest Test the classification effect and build a tile recognition model for the target area.

[0029] Specifically, S4.2 includes: labeltrn The image transformation operation is performed by transforms.Resize to unify the image size to 224×224, transforms.RandomHorizontalFlip to flip the image horizontally with a probability of 0.5, and transforms.RandomGrayscale to grayscale the image with a probability of 0.2. labelval Only transforms.Resize is performed to unify the image size to 224×224, and the recognition model test set D labeltest The operation is the same as identifying the model validation set.

[0030] The multiple sub-classifiers are ResNet, MobileNetV3, and EfficientNetV2.

[0031] According to another aspect of an embodiment of the present invention, a full-view digital slide image classification modeling device based on integrated deep learning is provided, comprising:

[0032] A collection module is used to collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked;

[0033] The first acquisition module is used to divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI;

[0034] The second obtaining module preprocesses the digital image slice tile obtained after segmentation by the first obtaining module to obtain the preprocessed digital image slice tile;

[0035] A training module is used to train a target area tile recognition model for the labeled digital image slice tiles collected by the collection module;

[0036] The first processing module is used to input the digital image slice tiles preprocessed by the second acquisition module into the target area tile recognition model trained in the training module, and select a group of digital image slice tiles that only contain the target area;

[0037] The partitioning module, for a set of digital image slices containing only the target area obtained by the first processing module, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ;

[0038] The second processing module is used to select multiple sub-classifiers. First, the pre-trained training set D obtained in the division module is used. trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters;

[0039] The third acquisition module is used to process the training set D after the first processing module trnMultiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in the second processing module. Then, the Majority Voting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results to obtain the final integrated prediction results; then, the verification set D processed by the first processing module is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test The performance of the classification model was tested and finally an image classification model was obtained.

[0040] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the full-field digital slice image classification modeling method based on integrated deep learning are implemented as described in any one of the above.

[0041] The beneficial effects of the present invention are as follows: taking into account the problems that conventional prediction methods use a single model, resulting in low model accuracy and poor generalization, the present invention trains a high-accuracy target area recognition model through pre-collected target area and non-target area tiles annotated by experts, which is used to screen all tiles of each WSI and only extract tiles containing the target area, greatly reducing the complexity of training and improving training efficiency; and introducing the idea of ​​ensemble learning, constructing three different classification networks that meet diversity conditions, and finally adopting an ensemble strategy to fuse the sub-classifier results to reduce the complexity of the problem and improve the model robustness, interpretability and prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 It is a flow chart of the present invention;

[0043] Figure 2 This is the confusion matrix diagram of the classification results under the ResNet model;

[0044] Figure 3 This is the confusion matrix diagram of the classification results under the MobileNetV3 model;

[0045] Figure 4 This is the confusion matrix diagram of the classification results under the EfficentNetV2 model;

[0046] Figure 5 It is a confusion matrix diagram of the full-view digital slice image classification modeling method based on integrated deep learning in the present invention;

[0047] Figure 2-Figure 5In the figure, Confusion matrix-confusion matrix, True Labels-real labels, PredictedLabels-predicted labels, non-metastasis-no transfer, metastasis-transfer. DETAILED DESCRIPTION

[0048] The invention is further described below in conjunction with the accompanying drawings and embodiments, but the content of the invention is not limited to the scope of the embodiments.

[0049] Embodiment 1: A full-view digital slide image classification modeling method based on integrated deep learning, comprising:

[0050] S1. Collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked;

[0051] S2. Divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI;

[0052] S3, preprocessing the digital image slice tile obtained after the segmentation in S2 to obtain the preprocessed digital image slice tile;

[0053] S4, training a target area tile recognition model for the labeled digital image slice tiles collected in S1;

[0054] S5, inputting the digital image slice tiles preprocessed by S3 into the target area tile recognition model trained in S4, and selecting a group of digital image slice tiles that only contain the target area;

[0055] S6, for a set of digital image slices tile containing only the target area obtained in S5, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ;

[0056] S7, select multiple sub-classifiers, first use the pre-training training set D obtained in S6 trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpreVerify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters;

[0057] S8, training set D after processing S5 trn Multiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in S7. Then, the Majority Voting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results and obtain the final integrated prediction results. Then, the validation set D processed by S5 is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test The performance of the classification model was tested and finally an image classification model was obtained.

[0058] Optionally, in S2, each full-view digital slice image WSI is subjected to a sliding window segmentation process, including: obtaining the total number of pyramid layers of the original full-view digital slice image WSI and the size of the target segmentation layer, and then calculating the number of window sliding times according to the set window size to segment the full-view digital slice image WSI of the selected target segmentation layer.

[0059] Optionally, the step of performing sliding window segmentation processing on each full-view digital slice image WSI in S2 includes:

[0060] S2.1. For the original full-view digital slice image WSI, first obtain its total pyramid layer number, assuming it is L all Layer, select L all -1 layer, i.e., 20× resolution image, is used as the target slice layer (in this example, the full-view digital slice image WSI with a maximum magnification of 40× resolution is collected), using level_demensions[L all -1] function obtains the size w and h of the target slice layer; where w is the width of the target slice layer and h is the length of the target slice layer;

[0061] S2.2. Calculate the number of window sliding times based on the size of the target slice layer obtained:

[0062]

[0063] In formula (1), win w Indicates the window width, N w The number of times the window slides horizontally, and is rounded down;

[0064]

[0065] In formula (2), win h Indicates the window length, N h The number of vertical sliding times of the window, rounded down;

[0066] S2.3, according to the calculated number of horizontal and vertical sliding of the window, use get_tile(L all -1,(N w ,N h )) function performs sliding window segmentation on the full-view digital slice image WSI of the target slice layer, and uses the imwrite method in the cv2 software package of Python to write out each tile and save it in png format.

[0067] Optionally, the preprocessing in S3 includes staining normalization, size normalization and blank screening.

[0068] Optionally, the target area tile recognition model construction process in S4 is as follows:

[0069] S4.1. First, the labeled digital image slices collected in S1 are divided into the recognition model training set D according to 7:2:1. labeltrn , identification model validation set D labelval And recognition model test set D labeltest ;

[0070] S4.2. Select Pytorch as the deep learning framework and train the recognition model on the training set D labeltrn The images are resized, horizontally flipped, and grayed. labelval The images of only size unification operation, recognition model test set D labeltest The operation is the same as identifying the model validation set;

[0071] S4.3. Select the residual neural network ResNet as the modeling network of the labeled area tile recognition model, and use the recognition model training set D labeltrn and recognition model validation set D labelval The residual neural network ResNet is trained and verified, and the training parameters of each batch are saved to finally obtain the evaluation index results of classification accuracy, sensitivity, and specificity; according to the evaluation index results of the recognition model verification set, the batch of parameters with the best performance is selected as the final parameters, and the recognition model test set D is used to labeltest Test the classification effect and build a tile recognition model for the target area.

[0072] Optionally, S4.2 specifically includes:labeltrn The image transformation operation is performed by transforms.Resize to unify the image size to 224×224, transforms.RandomHorizontalFlip (p = 0.5) to flip the image horizontally with a probability of 0.5, and transforms.RandomGrayscale (p = 0.2) to grayscale the image with a probability of 0.2. labelval Only transforms.Resize is performed to unify the image size to 224×224, and the recognition model test set D labeltest The operation is the same as identifying the model validation set.

[0073] Optionally, the multiple sub-classifiers are ResNet, MobileNetV3, and EfficientNetV2.

[0074] As the network deepens, the features become richer, but a network that is too deep will cause gradient explosion and gradient vanishing problems, and the optimization effect will be worse. ResNet is proposed to solve these problems. For the residual neural network ResNet is composed of a convolutional layer for feature extraction and a pooling layer for feature processing. The convolutional layer of ResNet is composed of multiple blocks with the same structure stacked together. Assuming x is the original input of the network, the features learned at this time are recorded as H(x), and ResNet hopes to learn the residual:

[0075] F(x)=H(x)-x (3)

[0076] Among them, x is the original input of the network, H(x) is the feature learned after the convolution layer, and F(x) is the residual between the feature and the original input;

[0077] In this way, the original learning feature is F(x)+x. When the residual is 0, only the identity mapping is performed in the block. Such residual learning is easier than direct learning of the original feature. It solves the problems of gradient explosion and gradient disappearance caused by the increase of network depth, so it can effectively deepen the depth of the network and make the results better. After the convolution operation of each convolution layer in the block, a nonlinear activation function must be input to increase the nonlinearity of the neural network model. The ReLu activation function is used in ResNet:

[0078] f(x)=max(0,x) (4)

[0079] Among them, x is the input of the activation function, max() is the maximum value function, and f(x) is the output of the activation function;

[0080] After the feature extraction operation, the input image is input into an adaptive average pooling layer to reduce the dimension of the features, and finally input into a fully connected layer to obtain the classification result, and then the cross entropy loss function is used to calculate the loss:

[0081]

[0082] In formula (5), N represents the total number of samples, i represents the sample, and y i Indicates the label of sample i, the positive class is 1 and the negative class is 0, p i Indicates the probability that sample i is predicted to be a positive class;

[0083] After calculating the loss, the back-propagation algorithm is used for optimization. The Adam optimizer is selected as the optimizer, which is simple to implement, efficient in calculation, and requires little memory. The hyperparameters are well interpretable and usually do not need to be adjusted or only require very little fine-tuning. The update step size can be limited to a rough range. It is very suitable for scenarios with large-scale data and parameters.

[0084] The classification accuracy (ACC):

[0085]

[0086] Among them, TP represents the number of samples predicted as positive; TN represents the number of samples predicted as negative; FP represents the number of samples predicted as positive; and FN represents the number of samples predicted as negative.

[0087] Sensitivity (SEN): The probability that a sample is actually a positive sample.

[0088]

[0089] Specificity (SPE): The probability of judging a sample to be negative when it is actually a negative sample.

[0090]

[0091] Specifically, the pre-training process in S7 is as follows:

[0092] (①First, the pre-training training set D obtained in S6 trnpre Input three sub-classifiers: ResNet, MobileNetV3, and EfficientNetV2 respectively. The training process of ResNet is the same as that in S4.

[0093] (②MobileNetV3 is the latest version of the MobileNet series. It has been improved on the previous two versions. Some time-consuming layers have been redesigned. The number of filters used in the expansion layer and the number of output channels in the bottleneck layer are optimized using the NetAdap algorithm. The number of channels is reduced by 3 or 4 times using the Squeeze-and-excitation module (SE). For the SE module, the sigmoid activation function is abandoned in the choice of activation function and the h-wish activation function is used instead:

[0094] h-swish(x)=x·ReLu6(x+3) / 6 (9)

[0095] Among them, x is the input variable and ReLu6 is the ReLu6 activation function:

[0096] ReLu6=min(6,max(0,x)) (10)

[0097] Among them, min is the minimum function and max is the maximum function.

[0098] The training process is the same as that in S4.

[0099] ③EfficientNetV2 is the latest version of the EfficientNet series. It improves the problems existing in the V1 version: when the size of the training image is large, the training speed is very slow, and the use of deep separable convolution in the shallow layer of the network is very slow. It proposes an improved progressive learning method, which dynamically adjusts the regularization method according to the size of the training image, and its training speed is faster and the number of parameters is reduced. The accuracy of the model has also been improved. In order to solve the problem that using depthwise separable convolution in shallow layers is slow, NAS technology is used to search for the best combination of MBConv and Fused-MBConv; for MBConv:

[0100] Assuming the input variable is x, x first passes through a 1×1 convolution layer, then enters a 3×3 depth-separable convolution layer, then enters an SE module, and finally passes through a 1×1 output; the Fused-MBConv structure is also very simple, that is, the 1×1 convolution layer and the 3×3 depth-separable convolution layer in the main branch of the original MBConv structure are replaced with an ordinary 3×3 convolution layer.

[0101] The SiLU activation function is used as the activation function:

[0102] SiLU=x·sigmoid(x) (11)

[0103] Among them, x is the input variable and sigmoid is the sigmoid activation function:

[0104]

[0105] The training process is the same as that in S4.

[0106] 4) Using the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre Select the best performing parameters and save them.

[0107] The prognosis prediction model training process in S8 is specifically as follows:

[0108] S8.1. D processed in S5 trn Input ResNet, MobileNetV3, and EfficientNetV2, three sub-classifiers, one by one for training; use Pytorch as the deep learning framework, and use the torch.load function to load the optimal parameters obtained by pre-training in S7 as initialization parameters when loading the model;

[0109] S8.2, D trn Each WSI tile is input into each sub-classifier for feature extraction, and then all features are fused through torch.cat. Then, they are input into an adaptive average pooling layer for dimensionality reduction. Finally, the fused and reduced features are input into the fully connected layer for output classification.

[0110] S8.3, the output results of the three sub-classifiers in S8.2 are calculated using the cross entropy loss function, and then optimized using the back propagation algorithm, and the optimizer uses the Adam optimizer;

[0111] S8.4, integrate the output results of the three sub-classifiers in S8.2 using the Majority Voting integration strategy, and finally output the integrated classification results;

[0112] S8.5, and then use the validation set D processed by S5 val , verify the performance of the model in each batch of training, and select the val The best performance parameters are used as the parameters of the classification model, and then the test set D is used test The performance of the test model was tested, and finally an image classification model with high accuracy was obtained.

[0113] Example 2: Figure 1-5 As shown, an optional specific method of the present invention is described in detail below.

[0114] Step 1: Collect HE-stained whole-field digital pathology slide images (Whole Slide Image, WSI) of gastric cancer patients in the cancer hospital. The format is svs, and the size of each image ranges from 2GB to 4GB. Also collect some digital image slice tiles with tumor areas and non-tumor areas of pathology images annotated and classified by experts;

[0115] Step 2: For the WSI in svs format, the Python openslide package was used to perform sliding window segmentation on the original WSI of each patient. The window size was 512×512, and the WSI was taken at 20× resolution. Finally, a set of tiles corresponding to each WSI was obtained and divided into training set D according to 7:2:1. trn , validation set D val and the test set D test ;

[0116] The DeepZoomGenerator method of the opensilde software package in Python is used to obtain the total number of pyramid layers of the original full-view digital slice image WSI and the size of the target slice layer, and then the number of window sliding times is calculated according to the set window size to segment the full-view digital slice image WSI of the selected target slice layer; the window involved in the calculation of the number of window sliding times w 、win h Both are set to 512;

[0117] Step 3: Perform preprocessing such as staining normalization, size normalization, and blank screening on the tiles obtained after segmentation in the second step, and obtain a set of digital image slice tiles with uniform staining degree, the same size, and no large amount of blank space after preprocessing;

[0118] Step 4: Train a target area tile recognition model based on the tiles with labeled tumor areas collected in the first step;

[0119] ① First, the collected gastric cancer pathology image tiles annotated by experts are divided into training set D according to 7:2:1. labeltrn , validation set D labelval and the test set D labeltest ;

[0120] ② Choose Pytorch as the deep learning framework and train the training set D labeltrnThe image is transformed, transforms.Resize unifies the image size to 224×224, transforms.RandomHorizontalFlip (p = 0.5) flips the image horizontally with a probability of 0.5, and transforms.RandomGrayscale (p = 0.2) grayscales the image with a probability of 0.2. For the validation set D labelval Only transforms.Resize is performed to unify the image size to 224×224, test set D labeltest The operation is the same as that of the validation set.

[0121] ③ Select ResNet as the modeling network of the tumor region recognition model; the residual neural network (ResNet) is composed of a convolutional layer for feature extraction and a pooling layer for feature processing. As the network deepens, the features become richer. However, a network that is too deep will cause gradient explosion and gradient disappearance problems, and the optimization effect will be worse. ResNet was proposed to solve these problems. The convolutional layer of ResNet is composed of multiple blocks with the same structure stacked together. Assuming x is the original input of the network, the features learned at this time are recorded as H(x), and ResNet hopes to learn the residual: that is, formula (3);

[0122] In this way, the original learning feature is actually F(x)+x. When the residual is 0, only the identity mapping is performed in the block. This residual learning is easier than the direct learning of the original feature. It solves the problems of gradient explosion and gradient disappearance caused by the increase of network depth. Therefore, it can effectively deepen the depth of the network and achieve better results. After the convolution operation of x in each convolution layer in the block, a nonlinear activation function must be input to increase the nonlinearity of the neural network model. The ReLu activation function is used in ResNet, that is, formula (4):

[0123] ④ After the feature extraction operation in ③, the input image is input into an adaptive average pooling layer to reduce the dimension of the features, and finally input into a fully connected layer to obtain the classification result, and then the loss is calculated using the cross entropy loss function, that is, formula (5):

[0124] After calculating the loss, the back-propagation algorithm is used for optimization. The Adam optimizer is selected as the optimizer, which is simple to implement, efficient in calculation, and requires little memory. The hyperparameters are well interpretable and usually do not need to be adjusted or only require very little fine-tuning. The update step size can be limited to a rough range. It is very suitable for scenarios with large-scale data and parameters.

[0125] ⑤ Again, according to the steps ③ and ④, use the training set Dlabeltrn and validation set D labelval The model is trained and verified, and the parameters of each batch of models are saved, and finally the classification accuracy (ACC) of the model is obtained, that is, formula (6);

[0126] Sensitivity (SEN), that is, formula (7): the probability that a positive sample is actually judged to be a positive sample.

[0127] Specificity (SPE), that is, formula (8): the probability that a sample is actually a negative sample and is judged to be a negative sample.

[0128] ⑥ According to the three evaluation indicators of the validation set, select a batch of parameters with the best model performance as the final recognition model parameters, and use them in the test set D labeltest Test the classification effect of the model.

[0129] Step 5: For the tiles preprocessed in step 3, input them into the tumor region tile recognition model trained in step 4 to select a group of tiles that only contain the tumor region in each WSI;

[0130] Step 6: For the tile obtained in step 5, change D trn All tiles are divided into two categories according to their labels: transfer and no transfer, and these two categories are divided into training set D according to 7:3. trnpre and validation set D valpre As pre-training data;

[0131] Step 7: In view of the diversity and complexity of pathological images, ResNet, MobileNetV3, and EfficientNetV2 are selected as sub-classifiers. First, the D trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the validation set D valpre The best performance parameters;

[0132] ① First, D obtained in step 6 trnpre Input the three sub-classifiers ResNet, MobileNetV3, and EfficientNetV2 respectively, where the ResNet training process is the same as the training process in the fourth step.

[0133] ②MobileNetV3 is the latest version of the MobileNet series. It has been improved on the previous two versions. Some time-consuming layers have been redesigned. The number of filters used in the expansion layer and the number of output channels in the bottleneck layer are optimized using the NetAdap algorithm. The Squeeze-and-excitation module (SE) is used to reduce the number of channels by 3 or 4 times. For the SE module, the sigmoid activation function is abandoned in the selection of activation function and the h-wish activation function is used instead, that is, formula (9)-(10).

[0134] The training process is the same as that in the fourth step.

[0135] ③EfficientNetV2 is the latest version of the EfficientNet series. It improves the problems existing in the V1 version: when the size of the training image is large, the training speed is very slow, and the use of deep separable convolution in the shallow layer of the network is very slow. It proposes an improved progressive learning method, which dynamically adjusts the regularization method according to the size of the training image, and its training speed is faster and the number of parameters is reduced. The accuracy of the model has also been improved. In order to solve the problem that using depthwise separable convolution in shallow layers is slow, NAS technology is used to search for the best combination of MBConv and Fused-MBConv; for MBConv:

[0136] Assume that the input variable is x, x first passes through a 1×1 convolution layer, then enters a 3×3 depth-separable convolution layer, then enters an SE module, and finally passes through a 1×1 output; the Fused-MBConv structure is also very simple, that is, the 1×1 convolution layer and the 3×3 depth-separable convolution layer in the main branch of the original MBConv structure are replaced with an ordinary 3×3 convolution layer. The SiLU activation function is used in the selection of its activation function, that is, formula (11)-(12):

[0137] The training process is the same as that in the fourth step.

[0138] ④Use the validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the validation set D valpre Select the best performing parameters and save them.

[0139] Step 8: Use the D processed in step 5 trnThree sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in the seventh step. Then, the Majority Voting integration strategy is introduced for the results of the three sub-classifiers to integrate the prediction results to obtain the final integrated prediction results. Then, the D val , verify the performance of the model in each batch of training, and select val The best performance parameters are used as the parameters of the classification model, and then D test The performance of the model was tested, and finally a model for predicting distant metastasis of gastric cancer pathology images with high accuracy was obtained.

[0140] ① Among them, D processed in the fifth step trn ResNet, MobileNetV3, and EfficientNetV2 are input one by one for training. The deep learning framework uses Pytorch. When loading the model, the torch.load function is used to load the optimal parameters obtained by pre-training in the seventh step as initialization parameters. The total training batch MAX_EPOCH is set to 100, BATCH_SIZE is set to 64, the learning rate LR is set to 0.001, the verification interval val_interval is set to 1, and the model save checkpoint interval checkpoint_interval is set to 2.

[0141] ②D trn Each patient's tile is input into each sub-classifier one by one for feature extraction, and then all the features are fused through torch.cat, and then input into an adaptive average pooling layer for dimensionality reduction. Finally, the fused and reduced features are input into the fully connected layer for output classification.

[0142] ③For the output results of the three sub-classifiers in ②, the loss is calculated by the cross entropy loss function, and then optimized using the back propagation algorithm. The optimizer uses the Adam optimizer, where the range of betas is (0.9, 0.999), and other parameters use the default parameters.

[0143] ④For the output results of the three sub-classifiers in ②, the MajorityVoting integration strategy is used to integrate the classification results, and finally the integrated classification results are output.

[0144] ⑤ Then use the D processed in the fifth step val , verify the performance of the model in each batch of training, and select val The best performance parameters are used as the parameters of the classification model, and then D test Test the performance of the model, draw the confusion matrix of the model classification results, and calculate the ACC, SEN, and SPE of the model.

[0145] The above method is applicable to the construction of a pathological image classification model based on integrated deep learning. This example verifies the effectiveness of the present invention by combining HE-stained full-field digital pathological slice images of gastric cancer patients in a cancer hospital. The batch of data contains a total of 492 WSI original images, of which 344 are used as training sets, 98 are used as validation sets, and 50 are used as test sets. The formats are all in svs format, and the size of each image ranges from 2GB to 4GB.

[0146] The implementation case of the present invention uses accuracy ACC, sensitivity SEN, and specificity SPE as evaluation indicators of model prediction performance. The calculation formulas of the three indicators have been given in the fourth step. The values ​​of the three indicators are all between 0 and 1. The closer to 1, the better the performance.

[0147] Table 1 Comparison of different methods in predicting distant metastasis in gastric cancer patients

[0148]

[0149] According to Table 1, it can be seen that the classification method proposed in the present invention is better than the single model method. The pathological image classification modeling method based on integrated deep learning proposed in the present invention has better performance. It not only uses the pre-trained tumor area recognition model to screen all tiles of each WSI and only extracts tiles containing tumor areas, which greatly reduces the complexity of training; it also draws on the idea of ​​transfer learning to pre-train each sub-classifier, determines a better initialization parameter, speeds up the model convergence speed, and improves the accuracy of the model; combines the Majority Voting integration strategy to fuse the results of the sub-classifiers, reduces the complexity of the problem, and improves the model robustness, interpretability and prediction accuracy. The present invention fully reflects its own advantages. Figure 2-Figure 5 As shown, the classification results obtained by the method of the present invention and other single model methods. From the classification results, it can be seen that the prediction accuracy of the present invention is higher than that of other models.

[0150] The above cases are used to illustrate the effectiveness and feasibility of the present invention. The focus of the present invention is to build multiple diverse sub-classifiers using multiple different high-performance networks, but the number of sub-classifiers is not limited to the fixed number in the implementation case. The introduction of the Majority Voting integration strategy is to solve the problem of low prediction accuracy and poor generalization performance of conventional single models due to the diversity and complexity of WSI, rather than targeting a specific case, and it is not intended to limit the present invention. Any modification or improvement of the present invention that is not made within the spirit and scope of protection of the claims of the present invention will be limited by the scope of protection of the present invention.

[0151] Embodiment 3: According to another aspect of the embodiments of the present invention, a full-view digital slice image classification modeling device based on integrated deep learning is provided, comprising:

[0152] A collection module is used to collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked;

[0153] The first acquisition module is used to divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI;

[0154] The second obtaining module preprocesses the digital image slice tile obtained after segmentation by the first obtaining module to obtain the preprocessed digital image slice tile;

[0155] A training module is used to train a target area tile recognition model for the labeled digital image slice tiles collected by the collection module;

[0156] The first processing module is used to input the digital image slice tiles preprocessed by the second acquisition module into the target area tile recognition model trained in the training module, and select a group of digital image slice tiles that only contain the target area;

[0157] The partitioning module, for a set of digital image slices containing only the target area obtained by the first processing module, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ;

[0158] The second processing module is used to select multiple sub-classifiers. First, the pre-trained training set D obtained in the division module is used. trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters;

[0159] The third acquisition module is used to process the training set D after the first processing module trnMultiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in the second processing module. Then, the Majority Voting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results to obtain the final integrated prediction results; then, the validation set D processed by the first processing module is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test The performance of the classification model was tested and finally an image classification model was obtained.

[0160] The full-field digital slice image classification modeling device based on integrated deep learning of the present invention is a device that can directly implement the above-mentioned full-field digital slice image classification modeling method based on integrated deep learning. The image classification model can be obtained through the device. Based on the model, it can be used in an intelligent terminal to predict the image to be tested. The predicted classification results can be used to assist clinical doctors in identifying the reliable parts of the classification results.

[0161] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of the full-field digital slice image classification modeling method based on integrated deep learning are implemented as described in any one of the above.

[0162] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A full-view digital slide image classification modeling method based on integrated deep learning, characterized by: include: S1. Collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked; S2. Divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI; S3, preprocessing the digital image slice tile obtained after the segmentation in S2 to obtain the preprocessed digital image slice tile; S4, training a target area tile recognition model for the labeled digital image slice tiles collected in S1; S5, inputting the digital image slice tiles preprocessed by S3 into the target area tile recognition model trained in S4, and selecting a group of digital image slice tiles that only contain the target area; S6, for a set of digital image slices tile containing only the target area obtained in S5, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ; S7, select multiple sub-classifiers, first use the pre-training training set D obtained in S6 valpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters; S8, training set D after processing S5 trn Multiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in S7. Then, the Majority Voting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results and obtain the final integrated prediction results. Then, the validation set D processed by S5 is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test Test the performance of the classification model and finally obtain an image classification model; In S2, each full-view digital slice image WSI is subjected to a sliding window segmentation process, including: S2.

1. For the original full-view digital slice image WSI, first obtain its total pyramid layer number, assuming it is L all Layer, select L all -1 layer is used as the target segmentation layer, and the sizes w and h of the target segmentation layer are obtained; where w is the width of the target segmentation layer, and h is the length of the target segmentation layer; S2.

2. Calculate the number of window sliding times based on the size of the target slice layer obtained: In formula (1), win w Indicates the window width, N w The number of times the window slides horizontally, and is rounded down; In formula (2), win h Indicates the window length, N h The number of vertical sliding times of the window, rounded down; S2.

3. According to the calculated number of horizontal and vertical sliding of the window, the full-view digital slice image WSI of the target slice layer is segmented by a sliding window, and each tile is written out and saved.

2. The full-view digital slide image classification modeling method based on integrated deep learning according to claim 1, characterized in that: In S2, each full-view digital slice image WSI is subjected to a sliding window segmentation process, including: obtaining the total number of pyramid layers of the original full-view digital slice image WSI and the size of the target segmentation layer, and then calculating the number of window sliding times according to the set window size to segment the full-view digital slice image WSI of the selected target segmentation layer.

3. The full-view digital slide image classification modeling method based on integrated deep learning according to claim 1, characterized in that: The preprocessing in S3 includes staining normalization, size normalization and blank screening.

4. The full-view digital slide image classification modeling method based on integrated deep learning according to claim 1, characterized in that: The target area tile recognition model construction process in S4 is as follows: S4.

1. First, the labeled digital image tiles collected in S1 are divided into the recognition model training set D labeltrn , identification model validation set D labelval And recognition model test set D labeltest ; S4.

2. Select Pytorch as the deep learning framework and train the recognition model on the training set D labeltrn The images are resized, horizontally flipped, and grayed. labelval The images of only size unification operation, recognition model test set D labeltest The operation is the same as identifying the model validation set; S4.

3. Select the residual neural network ResNet as the modeling network of the labeled area tile recognition model, and use the recognition model training set D labeltrn and recognition model validation set D labelval The residual neural network ResNet is trained and verified, and the training parameters of each batch are saved to finally obtain the evaluation index results of classification accuracy, sensitivity, and specificity; according to the evaluation index results of the recognition model verification set, the batch of parameters with the best performance is selected as the final parameters, and the recognition model test set D is used to labeltest Test the classification effect and build a tile recognition model for the target area.

5. The full-view digital slide image classification modeling method based on integrated deep learning according to claim 4 is characterized in that: Specifically, S4.2 includes: labeltrn The image transformation operation is performed by transforms.Resize to unify the image size to 224×224, transforms.RandomHorizontalFlip to flip the image horizontally with a probability of 0.5, and transforms.RandomGrayscale to grayscale the image with a probability of 0.

2. labelval Only transforms.Resize is performed to unify the image size to 224×224, and the recognition model test set D labeltest The operation is the same as identifying the model validation set.

6. The full-view digital slide image classification modeling method based on integrated deep learning according to claim 1, characterized in that: The multiple sub-classifiers are ResNet, MobileNetV3, and EfficientNetV2.

7. A full-view digital slice image classification modeling device based on integrated deep learning, characterized in that: include: A collection module is used to collect a batch of original full-view digital slice images WSI, and collect a batch of digital image slice tiles with target areas and non-target areas marked; The first acquisition module is used to divide the original full-view digital slice image WSI into a training set D trn , validation set D val and the test set D test , and perform sliding window segmentation processing on each original full-view digital slice image WSI to obtain a group of digital image slice tiles corresponding to each full-view digital slice image WSI; The second obtaining module preprocesses the digital image slice tile obtained after segmentation by the first obtaining module to obtain the preprocessed digital image slice tile; A training module is used to train a target area tile recognition model for the labeled digital image slice tiles collected by the collection module; The first processing module is used to input the digital image slice tiles preprocessed by the second acquisition module into the target area tile recognition model trained in the training module, and select a group of digital image slice tiles that only contain the target area; The partitioning module, for a set of digital image slices containing only the target area obtained by the first processing module, will belong to the training set D trn All digital image slices tiles are divided into two categories according to the labels, and these two categories are divided into the pre-training training set D trnpre and pre-training validation set D valpre ; The second processing module is used to select multiple sub-classifiers. First, the pre-trained training set D obtained in the division module is used. trnpre , pre-train each sub-classifier and save the parameters of each batch of training, and use the pre-training validation set D valpre Verify the performance of the sub-classifiers in each batch of training, and finally select the sub-classifiers in the pre-training validation set D valpre The best performance parameters; The third acquisition module is used to process the training set D after the first processing module trn Multiple sub-classifiers are input for training respectively, and the initialization parameters of the sub-classifiers are the optimal parameters obtained by pre-training in the second processing module. Then, the Majority Voting integration strategy is introduced for multiple sub-classifiers to fuse the prediction results to obtain the final integrated prediction results; then, the validation set D processed by the first processing module is used val Verify the performance of the model in each batch of training and select the model in the validation set D val The best performance parameters are used as the parameters of the final classification model, and then the test set D is used test Test the performance of the classification model and finally obtain an image classification model; The first acquisition module performs sliding window segmentation processing on each full-view digital slice image WSI, including: S2.

1. For the original full-view digital slice image WSI, first obtain its total pyramid layer number, assuming it is L all Layer, select L all -1 layer is used as the target segmentation layer, and the sizes w and h of the target segmentation layer are obtained; where w is the width of the target segmentation layer, and h is the length of the target segmentation layer; S2.

2. Calculate the number of window sliding times based on the size of the target slice layer obtained: In formula (1), win w Indicates the window width, N w The number of times the window slides horizontally, and is rounded down; In formula (2), win h Indicates the window length, N h The number of vertical sliding times of the window, rounded down; S2.

3. According to the calculated number of horizontal and vertical sliding of the window, the full-view digital slice image WSI of the target slice layer is segmented by a sliding window, and each tile is written out and saved.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the full-field digital slice image classification modeling method based on integrated deep learning are implemented as described in any one of claims 1 to 6.