Movatterモバイル変換


[0]ホーム

URL:


CN114066874B - Histopathology image classification method based on color deconvolution and self-attention model - Google Patents

Histopathology image classification method based on color deconvolution and self-attention model
Download PDF

Info

Publication number
CN114066874B
CN114066874BCN202111411631.9ACN202111411631ACN114066874BCN 114066874 BCN114066874 BCN 114066874BCN 202111411631 ACN202111411631 ACN 202111411631ACN 114066874 BCN114066874 BCN 114066874B
Authority
CN
China
Prior art keywords
model
image
matrix
deconvolution
color
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111411631.9A
Other languages
Chinese (zh)
Other versions
CN114066874A (en
Inventor
何柱
林铭炜
钟美荟
姚志强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujian Normal University
Original Assignee
Fujian Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujian Normal UniversityfiledCriticalFujian Normal University
Priority to CN202111411631.9ApriorityCriticalpatent/CN114066874B/en
Publication of CN114066874ApublicationCriticalpatent/CN114066874A/en
Application grantedgrantedCritical
Publication of CN114066874BpublicationCriticalpatent/CN114066874B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及基于颜色反卷积与自注意力模型的组织病理学图像分类方法,并提供了离线图像颜色反卷积与在线图像颜色反卷积两种方案,离线图像颜色反卷积方案通过先对RGB图像进行反卷积得到HED颜色空间图像,之后将HED图像输入自注意力模型得到图像的分类结果;在线颜色反卷积方案中将反卷积操作以卷积层的形式加入到自注意力模型中,先通过对模型进行训练并寻找合适的反卷积参数,之后迁移反卷积参数并再次利用加入反卷积操作的自注意力模型对图像进行分类;采用以上技术方案有效地将组织病理学图像反卷积与自注意力模型相结合,提高组织病理学图像分类的正确率。

The present invention relates to a histopathology image classification method based on color deconvolution and a self-attention model, and provides two schemes of offline image color deconvolution and online image color deconvolution. The offline image color deconvolution scheme first deconvolves an RGB image to obtain a HED color space image, and then inputs the HED image into a self-attention model to obtain an image classification result; in the online color deconvolution scheme, a deconvolution operation is added to the self-attention model in the form of a convolution layer, and the model is first trained and suitable deconvolution parameters are found, and then the deconvolution parameters are migrated and the self-attention model with the deconvolution operation added is used again to classify the image; the above technical scheme is used to effectively combine the histopathology image deconvolution with the self-attention model, thereby improving the accuracy of histopathology image classification.

Description

Histopathological image classification method based on color deconvolution and self-attention model
Technical Field
The invention belongs to the field of medical tissue cell image processing, and particularly relates to a tissue cell image classification method combining color deconvolution and a self-attention model.
Background
According to the published data of the world health organization international cancer research institution, in 2020, new cancer cases are about 1930 ten thousand worldwide, and the death number is about 1000 ten thousand. The number of newly increased breast cancer is 226 ten thousand, and the newly increased breast cancer accounts for 11.7% of the total new cancer cases, exceeds the number of newly increased lung cancer 220 ten thousand, and becomes the first cancer worldwide. In the diagnosis of breast cancer, examination of breast tissue sections by a pathologist remains the gold standard for clinical diagnosis. The development of digital pathology makes the number of digital histocyte images explosively increased, and with the increasing awareness of health and the increasing popularity of breast cancer diagnosis, there is an urgent need to find automated methods that can rapidly analyze histopathological images.
In histopathology, the most commonly used staining agents are hematoxylin and eosin. Wherein hematoxylin binds to nucleic acid, staining the nucleus in dark blue or purple, while eosin adheres to proteins in tissue, staining the cytoplasm and extracellular matrix in pink. Through the color deconvolution operation, the RGB image of the tissue cells dyed by hematoxylin and eosin can be subjected to color deconvolution, and the contribution of each coloring agent is calculated according to the absorbance of a specific coloring agent, so that the effect of separating the tissue dyed by the method is achieved.
In the past, the classification of the histopathological images often adopts a method of manually extracting image features or using machine learning, however, the methods have the characteristics of complicated steps, low efficiency, low accuracy and the like, and are difficult to use in the classification process of the actual tissue cell images.
Disclosure of Invention
In order to overcome the defects in the prior art, the invention provides a histopathological image classification method based on color deconvolution and a self-attention model, which is used for classifying deconvoluted images by performing deconvolution operation on tissue cell images and then utilizing the self-attention model, so that the accuracy of histopathological image classification is improved.
The histopathological image classification method based on the color deconvolution and the self-attention model adopts the following scheme: the method comprises the steps of adopting an offline image color deconvolution method or an online image color deconvolution method;
The offline image color deconvolution method comprises the following steps:
S100, acquiring a hematoxylin-eosin stained histopathological image dataset, wherein the histopathological image in the dataset is a standard RGB three-channel color image, and pixels of the RGB three-channel color image form a matrix Ht;
S200, setting a pixel point value with a pixel value of 0 in a matrix Ht as 1 multiplied by 10-7, and then normalizing each pixel value to form a new matrix Ht';
S300, multiplying the new matrix Ht' with the color deconvolution standard matrix to obtain a matrix Dt, wherein the matrix Dt is a matrix after the deconvolution of the pixel matrix Ht;
S400, normalizing the matrix Dt to obtain a matrix Dt ', wherein all elements of the matrix Dt' are in the interval [0,1 ];
S500, multiplying each element in the matrix Dt' by 255 and reserving an integer to obtain an HED color space image;
S600, dividing the HED color space images into a training set, a verification set and a test set according to a certain proportion, respectively training, verifying and evaluating the subsequent model, and scaling all the images; performing online data enhancement on the training set image;
S700, normalizing and normalizing the enhanced image;
S800, modifying the last full-connection layer into a single-layer MLP (Multilayer Perception) layer by using a swin-transducer model pre-trained on an ImageNet dataset, wherein the number of output neurons of the MLP layer is 2, and sending the training set image normalized by S700 into the model for fine tuning training;
and S900, verifying by using a verification set every fixed iteration times in the training process, selecting a model with the highest classification accuracy on the verification set in the iteration process, and then verifying by using a test set, thereby obtaining the final model classification accuracy.
The online image color deconvolution method comprises the following steps:
t100, acquiring a standard RGB three-channel histopathological image dataset subjected to hematoxylin-eosin staining;
T200, dividing images in a data set into a training set, a verification set and a test set according to a certain proportion, respectively performing training, verification and evaluation on the subsequent model, scaling all the images into images with the size of w multiplied by w, and performing online data enhancement operation on the training set images;
T300, performing the same normalization operation as the step S400 and the same normalization operation as the step S700 on the enhanced image;
T400, using a pre-trained swin-transducer self-attention model on the ImageNet dataset, modifying the last fully connected layer, and adding an input negation operation to the model head, namely outputting-x for each input value x. Then adding a layer of convolution layer, namely conv1, wherein the convolution kernel is 1 multiplied by 1, the number of input channels and the number of output channels are 3, no offset parameter is used, and the modified model is named as a de-swt model;
T500, using a pre-trained swin-transducer model on an ImageNet dataset, changing the last full-connection layer of the model into a single MLP layer, wherein the number of output neurons of the MLP layer is 2, adding an input negation operation to the head of the model, namely outputting-x for each input numerical value x, adding a layer of convolution layer, and recording as conv1, wherein the convolution kernel size is 1 multiplied by 1, the number of input channels and the number of output channels are 3, and recording the modified model as a de-swt model without using offset parameters;
t600, splitting the color deconvolution standard matrix into 3 multiplied by 1 matrixes according to columns, and loading the 3 multiplied by 1 matrixes into weight parameters of a conv1 layer of the de-swt model;
t700, inputting the training set standardized in the step T300 into a de-swt model, performing fine tuning training by using a specific learning rate lr, and setting the learning rate of the conv1 layer as p multiplied by lr in order to prevent gradient disappearance when the de-swt model reversely propagates to the conv1 layer, wherein p is the learning rate amplification factor, and increasing the learning rate of the model on the conv1 layer by using p so that parameters of the conv1 layer are changed along with iteration of the training set;
T800, in the training process of the step T600, verifying the model by using verification set data at intervals of a certain iteration number, selecting a model with a better effect on the verification set, extracting parameters of a model conv1 layer, combining the parameters into a new image color deconvolution matrix according to columns, and marking the new image color deconvolution matrix as N;
T900, loading each column value of the color deconvolution matrix N into conv1 layer parameters of the de-swt model, reloading swin-transducer parameters pre-trained on an ImageNet data set into other corresponding layers of the de-swt model, and setting p to 1 so that the learning rate in the conv1 layer is reset to lr;
And T1000, retraining the de-swt model obtained in the step T800 by using a training set, verifying the model by using verification set data at intervals of a certain iteration number, finally selecting the model with the highest accuracy on the verification set, and testing a model classification result by using a testing set, thereby obtaining the final model classification accuracy.
Further, in step S200, the pixel value of the pixel value 0 in the dataset is set to 1×10-7, and then the pixel value of the ith row and the jth column of the kth channel of Ht is setAnd (3) calculating:
where k represents R, G, B three channels, after which normalized pixel values are obtainedAnd a new matrix Ht' is constructed.
Further, in step S300, the matrix Ht' is multiplied by a color deconvolution standard matrix M, where M is:
Let Mk,c (1 is less than or equal to k, c is less than or equal to 3) be the element of the kth row c column of the matrix M,(C=1, 2,3, represent three channels of the image; 1.ltoreq.i.ltoreq.wt, 1.ltoreq.j.ltoreq.ht) is the pixel point of the ith row j column of the c-channel in the pixel matrix Dt, then:
The matrix Dt is formed, namely the result of the original image pixel matrix Ht after color deconvolution, wherein three color channels of the Dt are recorded as H, E, D and respectively represent the dyeing information of hematoxylin, eosin and diaminobenzidine, and the obtained matrix Dt is the HED color space matrix.
Further, in step S400, the matrix Dt is normalized to obtain Dt':
wherein (Dt) max, (Dt) min represent the maximum and minimum values, respectively, of the elements in the matrix Dt such that
Further, the same normalization operation as in step S400 is performed on the enhanced image in step S700, after which the mean value (μ1, μ2, μ3) = (0.458,0.456,0.406) and variance (σ1, σ2, σ3) = (0.229,0.224,0.225) of the three-channel pixels of the image dataset image are selected,
By the formula:
Each image is normalized.
Further, in steps S600 and T200, the training set is enhanced numerically, where the data enhancement includes randomly rotating the center, horizontally flipping, vertically flipping, scaling, and randomly changing the brightness, contrast, saturation, and hue of the image; the blank part of the edge of the rotated image center is complemented by 0 pixel, the brightness, contrast and saturation of the image are respectively randomly changed into 80-120%, 90-110% and 90-110% of the original image, and the hue change range is-0.1.
Further, in step T500, the deconvolution matrix is split into the following 33×1 column vectors, denoted as z1, z2, z3:
And loading the three column vectors as initial weight parameters of a de-swt model conv1 layer, and respectively carrying out convolution operation on input data by each z1, z2 and z3 in the calculation process of the de-swt model to obtain deconvoluted ith channel data, and finally obtaining H, E, D three channel information respectively.
Further, in step T700, the model with better effect on the verification set is selected as the model with classification accuracy lower than the highest accuracy obtained in the iterative process on the verification set.
Further, an attention mechanism is used within the swin-transducer model in the offline image color deconvolution method and the online image color deconvolution method.
Compared with the prior art, the invention has the following beneficial effects:
1. In step S200, the 0 pixel value is set to 1×10-7, so that the number of pairs of 0 pixels is prevented from being infinitesimal, and other smaller numbers such as: 1×10-6, and will not affect the subsequent classification;
2. In step S500, each normalized element in the matrix Dt' is multiplied by 255 and an integer is reserved, so that an HED color space image can be obtained, and information of each channel of H, E, D can be extracted to observe the result after dyeing and separating of each dye, which can be used for checking the dyeing and separating effect;
3. only in the steps S600 and T200, the height and width of the image can be changed by scaling the image, and the scaled size is suitable for the input of a subsequent model, and the deconvolution and image enhancement operations do not change the size of the image;
4. The training set is subjected to numerical enhancement, wherein brightness, contrast, saturation and hue of images of the training set are changed, so that the model has robustness to tissue pathology image dyeing difference, the model is not easy to be classified into errors caused by tissue dyeing condition difference, and the verification set and the test set are not subjected to data enhancement, so that the true classification effect of the model can be reflected by means of classification accuracy on the verification set and the test set;
5. In the step T800, a model with better effect on the verification set is selected to prevent conv1 layer parameters from being over-fitted to the data of the verification set;
6. the swin-transducer model uses an attention mechanism, and color deconvolution operation is combined with a self-attention mechanism, so that a good image classification effect can be achieved;
7. Because the model parameters pre-trained on the ImageNet dataset are used in the S700 and the T900, the standard values and variance values of the pixels of the ImageNet dataset are used for normalizing the dataset in the steps S600 and T300, so that the model can be better classified.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application, illustrate and/or provide a further understanding of the application, and wherein:
FIG. 1 is a flow chart of two embodiments of the present invention;
FIG. 2 is a detailed flow chart of two embodiments of the present invention;
FIG. 3 is a sample of BreakHis datasets of benign and malignant specimens;
FIG. 4 is a BreakHis dataset color deconvolution and channel separation sample;
FIG. 5 is a BreakHis dataset training set image data enhancement sample;
FIG. 6 is a graph of the change in the classification accuracy of the training set and the verification set during the training of the offline image color deconvolution model.
FIG. 7 is a graph showing the classification accuracy rate change of the training set and the verification set during training in the online image color deconvolution model step T800;
Fig. 8 is a training set and verification set classification accuracy change curve in the training process of the online image color deconvolution model step T1000.
Detailed Description
Referring to one of fig. 1-2, embodiments include two implementations of offline image color deconvolution or online image color deconvolution.
The method for implementing the offline image color deconvolution comprises the following steps:
Referring to fig. 3, S100, a hematoxylin-eosin stained histopathological image dataset is acquired, and BreakHis breast cancer histopathological image datasets are selected in this example, which are 7909 images acquired from 82 patients, 24 of which benign patients, from which 2480 benign images were acquired; the malignant patient 58 had 5429 malignant images, benign images and malignant image samples acquired from them. There are four magnifications in the dataset, 40-fold, 100-fold, 200-fold and 400-fold. The image sizes are 700 multiplied by 460, the images are scaled into images with the size of 224 multiplied by 224, and the pixels of each image form a matrix Ht with the size of 224 multiplied by 3, wherein 3 corresponds to R, G, B three channels of the image;
S200, set up(K=1, 2,3, representing the R, G, B channel of the image; 1.ltoreq.i, j.ltoreq.224) is an element in Ht,The values being within the standard RGB image pixel value range, i.eWhen (when)When 1X 10-7 is used for replacement, so thatAnd then calculating:
obtaining the normalized valueWherein the method comprises the steps ofAnd forms a matrix Ht';
s300, multiplying the matrix Ht' by a color deconvolution standard matrix M, wherein M is:
Let Mk,c (1 is less than or equal to k, c is less than or equal to 3) be the element of the kth row c column of the matrix M,(C=1, 2,3, representing three channels of the image; 1.ltoreq.i, j.ltoreq.224) is the pixel point of the ith row j column of the c-channel in the pixel matrix Dt, then:
The matrix Dt,Dt is the result of the original image pixel matrix Ht after the color deconvolution, wherein three color channels of Dt are H, E, D and respectively represent the dyeing information of hematoxylin (hematoxylin), eosin (eosin) and Diaminobenzidine (DAB), and the obtained matrix Dt is the HED color space matrix;
s400, using a formula:
Normalizing the matrix Dt to obtain Dt ', wherein (Dt)max、(Dt)min respectively represents the maximum value and the minimum value of the elements in the matrix Dt, so that the value is more than or equal to 0 and less than or equal to (yci,j)' -1;
Referring to fig. 4, S500, multiplying each element in the matrix Dt 'obtained in step S400 by 255 and reserving an integer, then obtaining an HED color space image after color deconvolution, and then separately extracting the H, E, D channels of Dt', so as to obtain a dyed and separated image, wherein the effect of dyeing and separating can be verified by observing the 3 channel images, and the result of color deconvolution and HED channel separation of the image can be obtained;
S600, the HED color space image obtained in the step S500 is processed according to the following steps of about 7:1.5:1.5 quantity divides training set, verification set, test set, is used for training, verification, aassessment to follow-up model respectively. Wherein all images of each patient are divided into only one of the training set, the verification set and the test set, and the images belonging to the same patient are always ensured not to appear in any 2 data sets of the training set, the verification set and the test set. Finally taking 5769 images of 59 patients as a training set, 1063 images of 11 patients as a verification set and 1077 images of the remaining 12 patients as a test set;
Referring to fig. 5, S700, performing online random data enhancement on training set data, setting the probability of horizontal overturn and vertical overturn of an image to be 0.5, and rotating a random center by 30 °, wherein the blank part of the edge of the rotated image center is complemented by 0 pixels, the brightness, contrast and saturation of the image are randomly changed to 80% -120%, 90% -110% and the hue change range is-0.1.
S800, performing the same normalization operation as that of step S400 on the enhanced image, and then selecting the mean value (μ123) = (0.458,0.456,0.406) and variance (σ123) = (0.229,0.224,0.225) of the three-channel pixels of the image dataset image. By the formula:
Normalizing each image;
s900, modifying the last full-connection layer into a single-layer MLP (Multilayer Perception) layer by using a swin-transducer model pre-trained on an ImageNet dataset, wherein the number of output neurons of the MLP layer is 2, and sending the normalized training set image into the model for fine tuning training. The batch size (batch size) of the images in the training process is set to be 32, and all training sets are trained for 20 times (epoch), and the models are trained together (iteration)And twice. The initial learning rate of the model is set to be 1 multiplied by 10-5, the learning rate of every 5 epochs is reduced to be 0.5 times, a cross entropy loss function is used for calculating a loss value, and an Adam optimizer is used for optimization;
referring to fig. 6, S1000, in the model training process, the trained model is verified by using a verification set every 72 item, and finally, 50 accuracy rates for classifying the verification set are obtained, and the highest accuracy rate on the verification set is 93.59% (marked by a circle in fig. 6). And selecting the model with the highest accuracy rate classified in the verification set, and verifying the model by using the test set. The final test set classification accuracy was 93.51%, and the test set classification results are shown in table 1 below.
Table 1: swin-transducer model Classification results
The online image color deconvolution implementation method comprises the following steps:
Referring to fig. 3, step S100 is the same as step S100 of the offline image color deconvolution scheme embodiment, and the images of the BreakHis datasets are acquired and scaled to 224×224, and the training set, the test set and the verification set are divided;
T200, performing corresponding online data enhancement on training set images of BreakHis data sets according to the step S600 in the offline image color deconvolution scheme;
t300, through the formula:
Pixel xki,j in each image Dt in BreakHis is normalized, where (Dt)max、(Dt)min represents the maximum and minimum values, respectively, of the elements in matrix Dt:
Normalizing pixels in Dt, wherein (μ123)=(0.458,0.456,0.406),(σ123)=(0.229,0.224,0.225);
T400, using a swin-transducer model pre-trained on an ImageNet dataset, changing the last connecting layer of the model into a single MLP layer, wherein the number of output neurons of the MLP layer is 2, and adding a negation operation on the head of the model, namely outputting-x to any input x. Then adding a layer of convolution layer, namely conv1, wherein the convolution kernel is 1 multiplied by 1, the number of input channels and the number of output channels are 3, no offset parameter is used, and the modified model is named as a de-swt (deconvolution swin transformer) model;
T500, splitting the deconvolution matrix into the following 3 column vectors of 3 multiplied by 1 according to columns:
loading the three column vectors as initial weight parameters of a de-swt model conv1 layer;
And T600, inputting the training set standardized in the step T300 into a de-swt model, and setting the initial learning rate lr of the model to be 1 multiplied by 10-5. The conv1 layer model learning rate magnification factor p is set to be 10, namely the conv1 layer initial learning rate is 1×10-4, and the rest layer learning rates are 1×10-5. The batch size (batch size) of the images in the training process is set to be 32, and all training sets are trained for 20 times (epoch), and the models are trained together (iteration)And twice. The learning rate lr is reduced to 0.5 times every 5 epochs, and optimization is carried out by using an Adam optimizer;
referring to fig. 7, in the model training process, the training model is verified by using a verification set every 72 item, and finally, 50 correct rates for classifying the verification set are obtained. The highest correct rate of the verification set is 94.52%, which is the test result of the 14 th verification set. The next highest accuracy of the validation set was 93.59% and the test results were obtained at the 15 th validation set (marked with circles in fig. 7). Selecting a model with the classification accuracy of 93.59% in the verification set, and extracting conv1 layer parameters of the model as follows:
combining the vectors column by column yields a new color deconvolution matrix M':
T800, reloading the swin-transducer model part in de-swt into parameters trained from an ImageNet dataset, wherein the conv1 layer learning rate magnification factor p is set to be 1, so that the learning rates of all layers of the model are kept consistent. The model was then retrained with the image batch size (batch size) set to 32 and all training sets training iterated (epoch) 20 times, model co-training (iteration)And twice. The initial learning rate of the model is set to be 1 multiplied by 10-5, the learning rate of every 5 epochs is reduced to be 0.5 times, a cross entropy loss function is used, and an Adam optimizer is used for optimization;
Referring to fig. 8, in the process of retraining the model in step T800, the trained model is verified with a verification set every 72 iterations, and finally, 50 accuracy rates for classifying the verification set are obtained. The model with the highest classification accuracy in the verification set (marked by circles in fig. 8) was selected, the highest classification accuracy in the verification set was 95.36%, and the model was verified by the test set, so that the classification accuracy of the test set was 94.17%, and the classification results are shown in table 2 below.
Table 2: de-swt model classification results
The above is a preferred embodiment of the present invention, and the results of the embodiment show that the combination of color deconvolution and self-attention model can achieve a good image classification effect. Both off-line image color deconvolution and on-line image color deconvolution use the swin-transducer model because the model uses the attention mechanism, and the models that can be used here are not limited to the swin-transducer model.
Although embodiments of the present invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made therein without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (7)

Translated fromChinese
1.基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:其包括采用离线图像颜色反卷积方法或在线图像颜色反卷积方法;1. A histopathological image classification method based on color deconvolution and self-attention model, characterized in that: it includes adopting an offline image color deconvolution method or an online image color deconvolution method;离线图像颜色反卷积方法步骤如下:The steps of offline image color deconvolution method are as follows:S100、获取经过苏木精-伊红染色的组织病理学图像数据集,所述数据集中的组织病理学图像为标准的RGB三通道彩色图像,其像素构成矩阵HtS100, obtaining a data set of histopathological images stained with hematoxylin-eosin, wherein the histopathological images in the data set are standard RGB three-channel color images, and the pixels thereof constitute a matrix Ht ;S200、将矩阵Ht中像素值为0的像素点值置为1×10-7,之后对每个像素值进行标准化,构成新的矩阵Ht';S200, setting the pixel value of 0 in the matrix Ht to 1×10-7 , and then standardizing each pixel value to form a new matrix Ht ';S300、将新的矩阵Ht'与颜色反卷积标准矩阵相乘,得到矩阵Dt,矩阵Dt即为像素矩阵Ht颜色反卷积后的矩阵;其中颜色反卷积标准矩阵M为:S300, multiplying the new matrix Ht ' by the color deconvolution standard matrix to obtain the matrix Dt, which is the matrix after the color deconvolution of the pixel matrix Ht ; wherein the color deconvolution standard matrix M is:设mk,c为矩阵M的第k行c列的元素,且1≤k,c≤3;为像素矩阵Dt中c通道的第i行j列的像素点;其中,c=1,2,3表示图像的三个通道;1≤i≤wt,1≤j≤ht,则:Let mk,c be the element in the kth row and cth column of the matrix M, and 1≤k,c≤3; is the pixel point in the i-th row and j-th column of the c-th channel in the pixel matrix Dt; where c=1,2,3 represents the three channels of the image; 1≤i≤wt ,1≤j≤ht , then:其中,表示Ht的第k个通道的第i行第j列的像素值,构成矩阵Dt,Dt即为原图像像素矩阵Ht经过颜色反卷积后的结果,其中Dt的三个颜色通道记为H、E、D,分别代表苏木精、伊红、二氨基联苯胺的染色信息,所得到的矩阵Dt即为HED颜色空间矩阵;in, represents the pixel value of the i-th row and j-th column of the k-th channel of Ht, The matrix Dt is formed. Dt is the result of color deconvolution of the original image pixel matrix Ht. The three color channels of Dt are recorded as H, E, and D, which represent the staining information of hematoxylin, eosin, and diaminobenzidine, respectively. The obtained matrix Dt is the HED color space matrix.S400、对矩阵Dt进行归一化,得到矩阵Dt',矩阵Dt'的所有元素都在区间[0,1]内;S400, normalizing the matrix Dt to obtain a matrix Dt ', where all elements of the matrix Dt ' are within the interval [0,1];S500、将矩阵Dt'中的每一个元素乘以255并保留整数,得到HED颜色空间图像;S500, multiply each element in the matrix Dt ' by 255 and retain the integer to obtain a HED color space image;S600、将HED颜色空间图像按一定的比例数量划分训练集、验证集、测试集,分别用于后续对模型进行训练、验证、评估,并对所有图像进行缩放;对训练集图像进行在线数据增强;S600, dividing the HED color space image into a training set, a validation set, and a test set according to a certain ratio, which are used for subsequent model training, validation, and evaluation, respectively, and scaling all images; performing online data enhancement on the training set images;S700、对增强后的图像进行归一化以及标准化;S700, normalizing and standardizing the enhanced image;S800、使用在ImageNet数据集上预训练好的swin-transformer模型,将最后全连接层修改为单层MLP层,其中MLP层输出神经元个数为2,并将S700归一化后的训练集图像送入到模型中进行微调训练;S800, using the swin-transformer model pre-trained on the ImageNet dataset, modifying the last fully connected layer to a single MLP layer, where the number of output neurons in the MLP layer is 2, and sending the training set images normalized by S700 to the model for fine-tuning training;S900、训练过程中每隔固定的迭代次数使用验证集进行验证,选取迭代过程中在验证集上分类正确率最高的模型,之后使用测试集进行验证,从而得到最终的模型分类正确率;S900, during the training process, the validation set is used for validation at fixed iteration times, and the model with the highest classification accuracy on the validation set is selected during the iteration process, and then the test set is used for validation, so as to obtain the final model classification accuracy;或者在线图像颜色反卷积方法步骤如下:Or the steps of online image color deconvolution method are as follows:T100、获取经过苏木精-伊红染色的标准的RGB三通道组织病理学图像数据集;T100, obtain a standard RGB three-channel histopathology image dataset stained with hematoxylin-eosin;T200、将数据集中图像按一定的比例数量划分训练集、验证集、测试集,分别用于后续对模型进行训练、验证、评估,并对所有图像进行缩放,缩放成大小为w×w的图像,之后对训练集图像进行在线数据增强操作;T200, divide the images in the data set into training set, validation set, and test set according to a certain ratio, which are used for subsequent model training, validation, and evaluation, respectively. All images are scaled to images of size w×w, and then online data enhancement operations are performed on the training set images;T300、对增强后的图像进行归一化操作以及标准化操作;T300, performing normalization and standardization operations on the enhanced image;T400、使用在ImageNet数据集上预训练好的swin-transformer自注意力模型,修改最后的全连接层,并在模型头部加入一个输入取反操作,即对每一个输入的数值x,都输出-x;之后再加入一层卷积层,记为conv1,其中卷积核大小为1×1,输入通道数与输出通道数都为3,不使用偏置参数,修改后的模型记为de-swt模型;T400, using the swin-transformer self-attention model pre-trained on the ImageNet dataset, modifying the last fully connected layer, and adding an input negation operation to the model head, that is, for each input value x, output -x; then add another convolution layer, denoted as conv1, where the convolution kernel size is 1×1, the number of input channels and the number of output channels are both 3, and no bias parameter is used. The modified model is denoted as the de-swt model;T500、将颜色反卷积标准矩阵M按列拆分成3个3×1的矩阵,将其加载到de-swt模型的conv1层的权重参数中;其中颜色反卷积标准矩阵M为:T500, split the color deconvolution standard matrix M into three 3×1 matrices by column, and load them into the weight parameters of the conv1 layer of the de-swt model; the color deconvolution standard matrix M is:T600、将步骤T300中标准化后的训练集输入到de-swt模型中,使用特定的学习率lr进行微调训练,为了防止de-swt模型在反向传播到conv1层时梯度消失,设置conv1层的学习率为p×lr,其中p为学习率放大倍数,利用p来增大模型在conv1层的学习率,使得conv1层的参数随着训练集的迭代而改变;T600, input the standardized training set in step T300 into the de-swt model, and use a specific learning rate lr for fine-tuning training. In order to prevent the gradient of the de-swt model from disappearing when back-propagating to the conv1 layer, the learning rate of the conv1 layer is set to p×lr, where p is the learning rate magnification factor. p is used to increase the learning rate of the model in the conv1 layer, so that the parameters of the conv1 layer change with the iteration of the training set;T700、在步骤T500的训练过程中,每隔一定的迭代次数间隔使用验证集数据对模型进行验证,选取在验证集上效果较优的模型,并提取模型conv1层的参数,按列组合为新的图像颜色反卷积矩阵,记为N;T700, during the training process of step T500, the model is verified using the validation set data at a certain interval of iterations, the model with better effect on the validation set is selected, and the parameters of the model conv1 layer are extracted, and combined into a new image color deconvolution matrix by column, recorded as N;T800、将颜色反卷积矩阵N的每一列数值加载到de-swt模型的conv1层参数中,并将在ImageNet数据集上预训练好的swin-transformer参数重新加载到de-swt模型其余相应的层中,将p设置为1,使得conv1层中的学习率重新设置为lr;T800, load each column value of the color deconvolution matrix N into the conv1 layer parameters of the de-swt model, and reload the swin-transformer parameters pre-trained on the ImageNet dataset into the remaining corresponding layers of the de-swt model, set p to 1, so that the learning rate in the conv1 layer is reset to lr;T900、使用训练集对步骤T700得到的de-swt模型重新进行训练,每隔一定的迭代次数间隔使用验证集数据对模型进行验证,最终选取在验证集上正确率最高的模型,并用测试集测试模型分类结果,从而得到最终的模型分类正确率。T900, use the training set to retrain the de-swt model obtained in step T700, and use the validation set data to validate the model at certain intervals of iterations. Finally, select the model with the highest accuracy on the validation set, and use the test set to test the model classification results, so as to obtain the final model classification accuracy.2.根据权利要求1所述的组织病理学图像分类方法,其特征在于:步骤S200中将数据集中像素值为0的像素点值置为1×10-7,之后对Ht的第k个通道的第i行第j列的像素值计算:2. The histopathological image classification method according to claim 1, characterized in that: in step S200, the pixel value of the pixel point with a pixel value of 0 in the data set is set to 1×10-7 , and then the pixel value of the i-th row and j-th column of the k-th channel of Ht is calculate:其中k代表R、G、B三个通道,之后得到标准化后的像素值并构成新的矩阵Ht'。Among them, k represents the three channels of R, G, and B, and then the standardized pixel value is obtained. And form a new matrix Ht'.3.根据权利要求1所述的基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:步骤S600或T200中对训练集进行数值增强,所述数据增强包括经过随机的中心旋转、水平翻转、垂直翻转、缩放,以及随机改变图像的亮度、对比度、饱和度、色相;其中将图像中心旋转后边缘空白部分用0像素补充,图像亮度、对比度、饱和度分别随机变化为原图像的80%~120%、90%~110%、90%~110%,色相变化范围为-0.1~0.1。3. The method for histopathological image classification based on color deconvolution and self-attention model according to claim 1 is characterized in that: in step S600 or T200, the training set is numerically enhanced, and the data enhancement includes random center rotation, horizontal flipping, vertical flipping, scaling, and random changes in image brightness, contrast, saturation, and hue; wherein the blank part of the edge after the image center is rotated is supplemented with 0 pixels, and the image brightness, contrast, and saturation are randomly changed to 80% to 120%, 90% to 110%, and 90% to 110% of the original image, respectively, and the hue change range is -0.1 to 0.1.4.根据权利要求1所述的基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:步骤T500中将颜色反卷积标准矩阵M按列拆分为如下3个3×1的列向量,记为z1、z2、z3:4. The method for histopathological image classification based on color deconvolution and self-attention model according to claim 1, characterized in that: in step T500, the color deconvolution standard matrix M is split into the following three 3×1 column vectors by column, denoted as z1, z2, z3:并将这三个列向量加载为de-swt模型conv1层的初始权重参数,在de-swt模型中计算过程中每个z1、z2、z3分别对输入的数据进行卷积操作,得到反卷积后的第i个通道数据,最终得出分别为H、E、D三通道信息。And these three column vectors are loaded as the initial weight parameters of the conv1 layer of the de-swt model. In the calculation process of the de-swt model, each z1, z2, and z3 perform convolution operations on the input data respectively to obtain the i-th channel data after deconvolution, and finally obtain the three-channel information of H, E, and D respectively.5.根据权利要求1所述的基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:步骤T600中将conv1层的学习率放大10倍,在步骤T700中进行训练得到新的conv1层的参数,之后将该层参数迁移到步骤T800的模型conv1层中,并将conv1层学习率放大倍数设为1,之后进行训练得到最终分类结果。5. The method for histopathological image classification based on color deconvolution and self-attention model according to claim 1 is characterized in that: in step T600, the learning rate of the conv1 layer is amplified by 10 times, and in step T700, training is performed to obtain parameters of a new conv1 layer, and then the layer parameters are migrated to the conv1 layer of the model in step T800, and the learning rate amplification factor of the conv1 layer is set to 1, and then training is performed to obtain the final classification result.6.根据权利要求1所述的基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:步骤T700中选取在验证集上效果较优的模型为选取在验证集上分类正确率低于迭代过程中得到的最高正确率的模型。6. The method for histopathological image classification based on color deconvolution and self-attention model according to claim 1 is characterized in that: in step T700, the model with better effect on the verification set is selected to select a model whose classification accuracy on the verification set is lower than the highest accuracy obtained in the iterative process.7.根据权利要求1所述的基于颜色反卷积与自注意力模型的组织病理学图像分类方法,其特征在于:所述离线图像颜色反卷积方法或在线图像颜色反卷积方法中的swin-transformer模型内使用注意力机制。7. The method for histopathological image classification based on color deconvolution and self-attention model according to claim 1 is characterized in that an attention mechanism is used in the swin-transformer model in the offline image color deconvolution method or the online image color deconvolution method.
CN202111411631.9A2021-11-252021-11-25 Histopathology image classification method based on color deconvolution and self-attention modelActiveCN114066874B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111411631.9ACN114066874B (en)2021-11-252021-11-25 Histopathology image classification method based on color deconvolution and self-attention model

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111411631.9ACN114066874B (en)2021-11-252021-11-25 Histopathology image classification method based on color deconvolution and self-attention model

Publications (2)

Publication NumberPublication Date
CN114066874A CN114066874A (en)2022-02-18
CN114066874Btrue CN114066874B (en)2024-11-19

Family

ID=80276162

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111411631.9AActiveCN114066874B (en)2021-11-252021-11-25 Histopathology image classification method based on color deconvolution and self-attention model

Country Status (1)

CountryLink
CN (1)CN114066874B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115100255B (en)*2022-06-162023-05-26赛维森(广州)医疗科技服务有限公司Image alignment method, image alignment device, computer equipment and storage medium
CN115272196B (en)*2022-07-112024-01-09东北林业大学Method for predicting focus area in histopathological image
CN117725844B (en)*2024-02-082024-04-16厦门蝉羽网络科技有限公司Large model fine tuning method, device, equipment and medium based on learning weight vector
CN119028602B (en)*2024-08-262025-08-12江苏护理职业学院 A case analysis method and system based on deep learning

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
FR3059453A1 (en)*2016-11-292018-06-01Centre National D'etudes Spatiales METHOD AND DEVICE FOR DECONVOLUTION OF DIGITAL IMAGES
CN110390678A (en)*2019-06-142019-10-29广东省人民医院(广东省医学科学院) A Tissue Type Segmentation Method for IHC Stained Images of Colorectal Cancer

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5859700A (en)*1995-11-221999-01-12Kairos Scientific, Inc.High resolution imaging microscope (HIRIM) and uses thereof
US10957421B2 (en)*2014-12-032021-03-23Syracuse UniversitySystem and method for inter-species DNA mixture interpretation
US10943345B2 (en)*2015-11-172021-03-09The Board Of Trustees Of The Leland Stanford Junior UniversityProfiling of pathology images for clinical applications
KR101879207B1 (en)*2016-11-222018-07-17주식회사 루닛Method and Apparatus for Recognizing Objects in a Weakly Supervised Learning Manner
KR102416202B1 (en)*2020-02-062022-07-04부경대학교 산학협력단Apparatus for classification based on convolution neural network with enhanced accuracy

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
FR3059453A1 (en)*2016-11-292018-06-01Centre National D'etudes Spatiales METHOD AND DEVICE FOR DECONVOLUTION OF DIGITAL IMAGES
CN110390678A (en)*2019-06-142019-10-29广东省人民医院(广东省医学科学院) A Tissue Type Segmentation Method for IHC Stained Images of Colorectal Cancer

Also Published As

Publication numberPublication date
CN114066874A (en)2022-02-18

Similar Documents

PublicationPublication DateTitle
CN114066874B (en) Histopathology image classification method based on color deconvolution and self-attention model
US11756198B1 (en)Systems and methods for training a statistical model to predict tissue characteristics for a pathology image
Zieliński et al.Deep learning approach to describe and classify fungi microscopic images
CN109086799A (en)A kind of crop leaf disease recognition method based on improvement convolutional neural networks model AlexNet
CN113744251B (en) Method for predicting microsatellite instability from pathological images based on self-attention mechanism
CN112819821B (en) A kind of nuclear image detection method
CN110033440A (en)Biological cell method of counting based on convolutional neural networks and Fusion Features
CN113450305B (en)Medical image processing method, system, equipment and readable storage medium
CN109816002B (en)Single sparse self-encoder weak and small target detection method based on feature self-migration
US12051253B2 (en)Method and apparatus for training a neural network classifier to classify an image depicting one or more objects of a biological sample
CN109871869B (en)Pulmonary nodule classification method and device
Khojasteh et al.A novel color space of fundus images for automatic exudates detection
Anandhakrishnan et al.Identification of tomato leaf disease detection using pretrained deep convolutional neural network models
CN112085727A (en)Intelligent identification method for scale structure on surface of hot rolled steel
CN112085067B (en) A method for high-throughput screening of DNA damage response inhibitors
CN118822920A (en) A color restoration correction method for microscope images by eliminating the color interference of dyes
Guerrero et al.Improvements in lymphocytes detection using deep learning with a preprocessing stage
CN111489353A (en)Fundus image fovea centralis positioning method
CN116205868A (en) A method and system for intelligent detection of pathological slice images
CN115018820A (en) Multi-classification method of breast cancer based on texture enhancement
CN114757916A (en) Defect classification method of industrial CT image based on feature extraction and BP network
CN114861771A (en) Defect classification method of industrial CT image based on feature extraction and deep learning
CN114972837A (en)Method for identifying microsatellite instability state from pathological picture based on RNN
Askar et al.Breast cancer classification using various cnn models
CN109978819A (en)A method of segmentation retinal vessel is detected based on low scale blood vessel

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp