Disclosure of Invention
In order to overcome the defects of the prior method, the invention aims to provide a tissue section classification method based on a microscopic hyperspectral imaging technology, and aims to improve the overall classification precision and speed and perfect the automatic data acquisition and classification process of pathological sections.
The solution of the invention is as follows:
the tissue slice classification method based on the microscopic hyperspectral imaging technology comprises the following steps:
1) system modeling
1.1) preprocessing microscopic hyperspectral data of a training set so as to eliminate noise influence and eliminate data redundancy;
1.2) training of three classes of Convolutional Neural Network (CNN) models
1.2a) one-dimensional CNN model
Establishing a CNN model, inputting the preprocessed data into the CNN model, and training the CNN model according to a one-dimensional spectrum curve (one-dimensional spectrum data) in the preprocessed data so as to realize feature extraction and classification of spectrum dimensions; determining the number of approximate network layers according to the number of samples and the spectral dimension, then adjusting the network structure according to the training result, and adjusting the parameter optimization network model of each layer;
1.2b) two-dimensional CNN model
Establishing a two-dimensional CNN model by using the model parameters and the structure determined in the step 3a) for reference;
performing Principal Component Analysis (PCA) on the preprocessed data, selecting the first m principal components as approximate expressions of an original image, and taking K multiplied by K neighborhood pixel points (namely K multiplied by m) of a current pixel as the input of a two-dimensional CNN model; after training, the preprocessed data are converted into a series of feature vectors; in addition, spectral line features (one-dimensional spectral data) are extracted from the preprocessed data; inputting the features of the two aspects into an LR layer for classification, thereby realizing the combined feature extraction and classification of the spectrum-spectrum dimension;
1.2c) three-dimensional CNN model
Establishing a three-dimensional CNN model by using the model parameters and structures determined in the step 1.2a) and the step 1.2b) (simultaneously using a one-dimensional CNN model and a two-dimensional CNN model for reference);
taking K multiplied by b neighborhoods of a current pixel as the input of a three-dimensional CNN model, wherein b is the number of spectral segments, inputting a series of obtained feature vectors into an LR layer for classification after training, and further realizing the combined feature extraction and classification of the spectral-spectral dimensions;
2) tissue section classification aiming at actual microscopic hyperspectral image to be detected
Referring to the step 1.1), preprocessing actual microscopic hyperspectral data to be detected;
carrying out quantitative and qualitative analysis on the preprocessed data, and evaluating whether the requirements can be met only by carrying out spectral dimension feature extraction and classification according to the number of samples (magnitude of order) and spectral features (number of spectral segments and spectral resolution);
if so, inputting the preprocessed data into the one-dimensional CNN model trained in the step 1.2a) to realize the feature extraction and classification of the spectral dimension, and taking the classification result output by the model as a final classification result;
if not, respectively referring to the step 1.2b) and the step 1.2c), spectrum-spectrum dimension combined feature extraction and classification are realized through the trained two-dimensional CNN model and the trained three-dimensional CNN model (wherein for the two-dimensional CNN model, the preprocessed data is specifically subjected to PCA (principal component analysis) processing, KxKxm is used as the input of the two-dimensional CNN model, and one-dimensional spectrum data is combined on an LR layer to obtain a classification result; for the three-dimensional CNN model, K multiplied by b neighborhoods are directly used as the input of the three-dimensional CNN model to obtain a classification result); and finally voting (decision fusion is carried out by applying a voting method and a linear opinion pool) on the classification results output by the two models to obtain a final classification result.
Wherein, the step 1.1) may specifically be: firstly, eliminating the influence of random noise by adopting low-pass filtering, then carrying out strip removal processing on each spectral band image, and simultaneously eliminating the influence of high-frequency noise by using an S-G first-order derivative; and whitening processing is employed to reduce the correlation between the data.
Step 1.2a) may specifically comprise the steps of:
(1) initialization:
randomly initializing a network parameter theta, iter being 0, err being 0, nbDetermining each layer type and an activation function type as 0; determining a model input n1Output npNumber of iterationsImaxAnd a learning rate α;
(2) iterative training:
firstly, inputting one-dimensional spectral data, setting xiIs the ith layer input, calculates each network layer output;
wherein, WiAnd biRespectively a weight matrix and a bias matrix of the ith layer, wherein s is an excitation function, and P (y is l) predicts the probability of belonging to the ith class in the current iteration;
then, the cost function J (theta) and partial derivative are calculatedi;
Where m is the number of training samples, Y is the target output, Y is the prediction output,
represents a dot product function;
continuously updating the parameter theta by using a gradient descent method in training;
and finally, gradually training the network to be optimal as the return value of the cost function is smaller, and finishing the training of the CNN model after the set threshold value is reached.
The invention has the following technical effects:
the invention researches the tissue structure form and the spectrum information in the pathological section, and utilizes the deep learning convolutional neural network model to extract and classify the deep features of the tissue structure form and the spectrum information, thereby improving the overall classification precision and speed and perfecting the automatic data acquisition and classification process of the pathological section.
Detailed Description
In order to make the technical solution and advantages of the present invention more clear, the present invention will be described in more detail with reference to the accompanying drawings and specific embodiments.
As shown in figure 1, the microscopic hyperspectral imager consists of a hyperspectral imaging system, a biological microscope system and a control computer, wherein the system comprises 256 wave bands, the spectral range is 400 nm-1000 nm, the average spectral resolution is 3nm, the spatial resolution can reach 0.5 mu m, and the image size is 753 × 696.
During experiments, microscope objectives with different magnifications (such as 4 x, 10 x, 20 x, 40 x and 100 x) can be selected according to different targets, the light source intensity is adjusted, the sample is not easy to saturate by adjusting a focusing mechanism, a target area is selected, and a microscopic hyperspectral image of a pathological section in the area is acquired. Keeping the brightness of the light source and the magnification unchanged, moving the section to select other areas or replacing other pathological sections, collecting a plurality of microscopic hyperspectral images by the same method, and storing the images in a classified manner. Taking pathological section of gastric cancer as an example, the pathological section of gastric cancer and the normal tissue section are respectively from samples of a plurality of patients with gastric cancer and normal human bodies, and isolated pathological tissues need to be subjected to H-E staining after being embedded, sliced, dewaxed and the like. After dyeing, doctors carry out detailed marking to divide cancerous regions and normal regions, and data acquisition and classification training are carried out on the basis of the cancerous regions and the normal regions during experiments.
Step one, preprocessing microscopic hyperspectral data: considering the influence of a light source and a sensor on the imaging quality, firstly adopting low-pass filtering to eliminate the influence of random noise; then, carrying out banding removal processing on each spectral band image, and eliminating the influence of high-frequency noise by using an S-G first-order derivative; and finally, whitening processing is carried out, mainly for reducing the correlation among all the characteristics and the data complexity, and the method is favorable for the stability and the high efficiency of a later model.
The main process of the whitening treatment is as follows:
(1) firstly, assuming original hyperspectral data as x, constructing an autocorrelation matrix R of the original datax=E(xxT)≠I
(2) Then find matrix B transforms x by y ═ Bx, such that autocorrelation matrix Ry=BE(xxT)BT=Ι
(3) Transforming B ═ Λ-1/2ΦTObtaining Ry=(Λ-1/2ΦT)ΦΛΦT(Λ-1/2ΦT)T=I
Finally, the y components are uncorrelated through the transformation of B, and the aim of eliminating data redundancy is fulfilled.
Step two, extracting and classifying spectral dimensional features:
inputting the preprocessed data into a CNN model for training, firstly establishing a 1-D CNN model, determining the number of approximate network layers according to the number of samples and spectral dimensions, then adjusting the network structure according to the training result, and adjusting parameters of each layer to optimize the network model. The final CNN model contains seven layers, including input layer I1, two convolutional layers C2 and C4, two pooling layers P3 and P5, full-link layer F6, and output layer O7. The first convolutional layer contains 8 convolutional kernels, and the size of the convolutional kernel is 5; the second convolution kernel contains 16 convolution kernels, with a convolution kernel size of 5. Thereafter, a maxporoling pooling layer was ligated, followed by a fully-ligated layer containing 100 neurons. Meanwhile, overfitting can be effectively prevented by applying the nonlinear functions ReLU and dropout method, and when the dropout parameter is set to be 0.25, the training convergence speed is fastest.
The main process of training the CNN model for one-dimensional spectral curves is shown in fig. 2:
(1) initialization: randomly initializing a network parameter theta, iter being 0, err being 0, nbEach layer type and activation function type are determined as 0. Determining a model input n1Output npNumber of iterations ImaxAnd a learning rate α.
(2) Iterative training:
firstly, inputting one-dimensional spectral data, calculating the output of each network layer,
wherein, WiAnd biRespectively are a weight matrix and a bias matrix of the ith layer, and y is the probability of each class currently attributed.
The cost function J (θ) and partial derivatives are then calculated.
Where m is the number of training samples, Y is the target output, Y is the prediction output,
representing a dot product function.
The parameter theta is continuously updated by a gradient descent method in the training process,
and finally, gradually training the network to be optimal as the return value of the cost function is smaller, and finishing the training of the CNN model after a certain threshold value is reached.
Step three, spectrum-spectrum dimension combined feature extraction and classification:
in order to more effectively apply spatial information such as tissue texture and cell structure of pathological sections, more detailed image dimensional characteristics need to be learned on the basis of spectrum dimension, and model performance and tumor tissue classification efficiency can be effectively improved. The method can be realized by respectively adopting a 2-D CNN model and a 3-D CNN model:
A2-D CNN model is established, which comprises 3 layers of convolution, a ReLU activation function and a max-posing layer. In order to make the model have better generalization performance, the number of parameters of the model, namely the layer number and the scale of each layer, needs to be controlled, so that a smaller convolution network is used, and the number of filters in each layer is not large. Before training, Principal Component Analysis (PCA) is firstly carried out on original data, the first m principal components are selected as approximate expressions of an original image, and K multiplied by K neighborhood pixel points (namely K multiplied by m) of a current pixel are used as input of a model. Considering the image size, cell structure and slice tissue characteristics, the neighborhood window K takes a value of 45, the convolution kernel size is 5, and 32, 64 and 128 convolution kernels are respectively arranged on the three convolution layers. The reserved spectrum information can be adjusted by changing the number of the selected principal components, and experiments prove that 3-5 principal components are reserved, so that good classification accuracy can be obtained. For example, the first 3 principal components after PCA processing may be selected as an approximate representation of the raw data, with a 45 × 45 neighborhood (i.e., 45 × 45 × 3) of the current pixel as the model input. ReLU activation and dropout methods are adopted in the training process, so that overfitting can be effectively inhibited. After CNN training, the original data are converted into a series of feature vectors, the features are input into an LR layer for classification, and meanwhile, one-dimensional spectral data are also used as feature input, so that combined feature extraction and classification of a spectrum-spectral dimension are realized, as shown in FIG. 3.
Establishing a 3-D CNN model, taking K multiplied by b neighborhoods of a current pixel as the input of the 3-D CNN model, wherein b is the number of spectral segments, the size of a convolution kernel of each layer is 5 multiplied by 32, sampling is carried out by a pooling layer 2 multiplied by 2 kernel, and finally, the samples are input into an LR layer for classification, thereby realizing the combined feature extraction and classification of the spectrum-spectrum dimension. ReLU activation and dropout methods are adopted in the training process, so that overfitting can be effectively inhibited. Under a proper 3-D CNN framework, neighborhood pixel points in all spectral bands can be utilized to fully learn the spectral and spatial characteristics of tumor tissues.
Step four, classifier integration and result visualization:
and selecting one of the classification results of the CNN models as a final classification result of the tumor tissue and the normal tissue.
For the hyperspectral image of the tissue section, the relation between medical pathological change and the features obtained by training is better understood, and the model can be explained according to the learned features of different cancer clinical manifestations. Therefore, a deconvolution network is added in the 2-D CNN model, and the deconvolution network has no learning ability and is only used for detecting a trained CNN. And (3) taking the feature maps obtained by each layer as input, reconstructing corresponding input stimuli by operations such as inverse pooling, inverse activation, deconvolution and the like after the feature maps are activated to the original input layer, displaying more useful information on the features by the reconstructed stimuli, realizing model tuning by analyzing the information, and researching clinical interpretation between the learned features and cancer classification.
As shown in fig. 4, in the tissue section classification method of the present invention, firstly, the actual microscopic hyperspectral data to be measured is preprocessed; then, carrying out quantitative and qualitative analysis on the preprocessed data, and evaluating whether the spectrum dimensional feature extraction and classification can meet the requirements or not according to the number (magnitude) of samples and the spectrum features; if so, inputting the preprocessed data into the trained one-dimensional CNN model to realize the feature extraction and classification of the spectral dimension, and taking the classification result output by the model as a final classification result; if not, the two-dimensional CNN model and the three-dimensional CNN model after training are respectively used for realizing the combined feature extraction and classification of the spectrum-spectrum dimension, and voting (decision fusion is carried out by applying a voting method and a linear opinion pool) is carried out on the classification results output by the two models to obtain the final classification result.
The results of the accuracy, sensitivity and specificity of the different methods are shown in FIG. 5, comparing the methods of the present invention with other methods. The experimental results show that: the tissue section classification method based on the microscopic hyperspectral imaging technology can efficiently extract the structural feature and spectral feature difference of a pathological tissue and a normal tissue, and the CNN model established based on the method can realize accurate identification of the pathological tissue and the normal tissue, thereby realizing the automatic data acquisition and classification process of pathological sections.