Small sample medical image classification method based on unsupervised meta learning

Through the unsupervised meta-learning method, pseudo-labeling and data enhancement technology are used to build a medical image classification model that does not require labeling, which solves the problems of small data volume and high labeling cost in small sample learning in the field of medical images, and achieves high accuracy. Medical image classification.

CN118657996APending Publication Date: 2024-09-17CENT SOUTH UNIV
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202410802495.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-20
Publication Date
2024-09-17

AI Technical Summary

Technical Problem

In the field of medical images, small sample learning methods require a large number of base class labels and are limited by privacy and security issues, resulting in poor performance in actual medical image classification. Moreover, the annotation of medical images requires professional knowledge, high cost, and high accuracy and annotation precision. Related.

Method used

Adopt a small-sample medical image classification method based on unsupervised meta-learning. By obtaining medical image data for sampling and data enhancement, an initial medical image classification model is constructed. Pseudo-labels are used for training and verification to build a classification model that does not require labeling, including features. The extraction module and similarity calculation module use cross-entropy loss and semi-cosine similarity calculation for model training and adjustment.

Benefits of technology

It overcomes the problem of small amount of medical image data and uneven distribution, achieves low-cost and high classification accuracy medical image classification, and avoids the need to label samples.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118657996A
    Figure CN118657996A
Patent Text Reader

Abstract

The invention discloses a small sample medical image classification method based on unsupervised meta learning. The method comprises the following steps: acquiring medical image data; the method comprises the following steps: sampling medical image data, performing data enhancement on samples obtained by sampling, performing image processing to obtain a training data set with a pseudo tag, and dividing the training data set into a training set and a verification set; constructing an initial medical image classification model based on the prototype network basic framework; training the initial medical image classification model by adopting the training set to obtain a training set data classification model; using the verification set to adjust the training set data classification model to obtain a medical image classification model; and performing actual medical image classification by using the medical image classification model. According to the method, the problems that the medical image is small in data size and uneven in distribution are solved, the samples do not need to be marked, and compared with an existing method, the method has the advantages of being low in cost and high in classification accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to a medical image recognition and classification method, and specifically relates to a small sample medical image classification method based on unsupervised meta-learning. Background Art

[0002] Few-shot learning plays a key role in many fields such as visual recognition and object detection, making it possible to train models using limited data. Currently, common few-shot learning methods include metric learning and meta-learning.

[0003] The object of metric learning is usually the distance between sample feature vectors. Through training and learning, the distance between samples of the same category is reduced or limited, while the distance between samples of different categories is increased. The basic premise of metric learning is to customize a suitable distance metric function or matrix according to the specific requirements of the task, so that samples of the same category can be close in the metric space, and samples of different categories can keep their distance directly.

[0004] Meta-learning methods typically involve training on few-shot tasks derived from a base class during the training phase. The process revolves around optimizing two key loops: meta-training and meta-testing. In classification tasks, multiple support samples are often used to classify new samples. In meta-training, the neural network parameters are updated using the training data points for each task. Subsequently, in the meta-testing phase, the data for each task is adaptively tested, allowing the model to quickly adapt to new tasks and classify between tasks.

[0005] Small sample learning has achieved remarkable results in various fields. However, in the field of medical images, research on small sample learning is relatively limited. Although small sample learning performs well in new types of tasks with limited data, it still requires a considerable number of base class labels in the meta-training stage. This makes small sample learning perform poorly in the classification of medical images in actual medical theoretical research environments. The annotation of medical images requires domain expertise and is easily affected by subjective factors, while the accuracy of the model is positively correlated with the accuracy of the annotation. Providing sufficient annotation labels during the training process of the model is costly. In addition, due to privacy and security considerations, the number of publicly available samples is relatively limited. Therefore, there is an urgent need for a medical image classification method that requires a small sample size and does not require sample annotation. Summary of the invention

[0006] The purpose of the present invention is to provide a small sample medical image classification method based on unsupervised meta-learning.

[0007] The present invention provides a small sample medical image classification method based on unsupervised meta-learning, comprising the following steps:

[0008] S1. Acquire medical image data;

[0009] S2. Sampling the medical image data obtained in step S1, performing data enhancement on the sampled samples, and then performing image processing to obtain a training data set with pseudo labels, and dividing the training data set into a training set and a validation set;

[0010] S3. Based on the basic framework of the prototype network, build an initial medical image classification model;

[0011] S4. Using the training set obtained in step S2, the initial medical image classification model obtained in step S3 is trained to obtain a training set data classification model;

[0012] S5. Using the validation set obtained in step S2, the training set data classification model obtained in step S4 is adjusted to obtain a medical image classification model;

[0013] S6. Use the medical image classification model obtained in step S5 to perform actual medical image classification.

[0014] The medical images described in step S1 include cell images, organ tissue images and CT images.

[0015] Step S2 is specifically as follows: randomly sampling the medical image data obtained in step S1 to obtain N sample images, automatically enhancing the sample images, enhancing the same image data to obtain image data of the same category, randomly selecting K images from each category as the support set, and Q images as the query set, repeating the above sampling steps in each round to obtain several groups of support sets and query sets as base class data sets, randomly selecting K images from the remaining S categories as the support set, and Q images as the query set, repeating the above sampling steps to obtain several groups of support sets and query sets as training data sets with pseudo labels; the automatic enhancement is specifically as follows: defining a search space, in which there are 16 types of image enhancement, namely: AutoContrast(0,1), Equalize(0,1), Invert(0,1), Rotate(0,30), Solarize( 0,256),SolarizeAdd(0,110),Color(0.1,1.9),Posterize(0,4),CutoutAbs(0,40),Contrast(0.1,1.9),Brightness(0.1,1.9),Sharpness(0.1,1.9),ShearX(0,0.3),ShearY(0,0.3),TranslateX(0,100),TranslateY(0,100), where the range in brackets is the amplitude value range for image enhancement corresponding to the graphic transformation method. When searching in the search space, the amplitude value is uniformly taken as ii values ​​within the defined range. Each time a data enhancement operation is performed, two enhancement methods are randomly selected from the search space. The total amplitude is xx, which is expressed as follows:

[0016] val=xx×(max-min)+min

[0017] Among them, val is the adjusted parameter; max is the upper limit of the amplitude value before adjustment; min is the lower limit of the amplitude value before adjustment; the training data set is randomly cropped to images of preset pixel size, randomly inverted according to the preset probability, and the brightness, contrast and saturation are offset by the preset amplitude, and finally normalized and divided into training set and validation set; image enhancement is only used for model training, and the input image data is not enhanced when applied.

[0018] The initial medical image classification model described in step S3 includes a feature extraction module and a similarity calculation module; the feature extraction module includes a first 1×1 convolution kernel, BatchNorm2d, a ReLU layer, a first extraction module, a second extraction module, a third extraction module, a fourth extraction module, a second 1×1 convolution kernel, and an adaptive average pooling module connected in series in sequence; the input data is first processed by the first 1×1 convolution kernel to combine high-level network features with low-level network features; the result output by the first 1×1 convolution kernel is first normalized using BatchNorm2d, and then preliminarily screened by the ReLU layer;

[0019] The output of the ReLU layer is used as the input of the first extraction module; the first to fourth extraction modules have the same structure, including the first 3×3 convolution kernel, the first BatchNorm2d, the first ReLU layer, the second 3×3 convolution kernel, the second BatchNorm2d, and the second ReLU layer connected in series in sequence; the second 1×1 convolution kernel uses the output of the second ReLU layer in the first to fourth extraction modules as input, fuses the features extracted by each extraction module, and then inputs them into the adaptive average pooling module to obtain the model classification result;

[0020] The similarity calculation module is based on the calculation of cosine similarity and calculates the category confidence through the following half cosine calculation formula:

[0021]

[0022] Among them, P n is the center point and φ(·) is the prediction result of the model; y i is the pseudo label during model training; n is the number of data categories; x is the feature vector of the input medical image data; x j is the feature vector of the image in the support set; k is the number of images in the support set; sim sns is the half cosine similarity;

[0023] In step S4, cross entropy loss is used for training, and the loss function is expressed as follows:

[0024]

[0025] Where N is the number of training samples; p i is the probability value of the predicted pixel; y i is the pseudo label for training; M is the total number of categories; c is the number of categories; a group of support sets and query sets are taken as a small batch sampling, and each round of training calculation will calculate the average loss value of at least kk small batch samplings. After training for at least mm rounds, the model parameters with the highest accuracy of the validation set are selected and saved to obtain the classification model of the training set data.

[0026] In step S5, the training set data classification model obtained in step S4 is verified using the validation set, and trained again to optimize the scalability of the model on new categories, thereby obtaining a medical image classification model.

[0027] The actual medical image classification is performed using the medical image classification model obtained in step S5 in step S6, which specifically includes the following steps:

[0028] a. Obtain actual medical image data;

[0029] b. Processing the medical image data obtained in step a to obtain an image data set;

[0030] c. Input the image data set obtained in step b into the medical image classification model obtained in step S5 to obtain the classification result, thereby completing the actual medical image classification.

[0031] If the acquired medical image data is a cell image, the model classification result is the cell type; if the acquired medical image data is an organ tissue image, the model classification result is the organ tissue type; if the acquired medical image data is a CT image, the model classification result is the disease type.

[0032] Step b specifically includes: cropping the medical image data obtained in step a, converting the image size to a preset pixel size, and performing normalization processing.

[0033] The present invention discloses a small sample medical image classification method based on unsupervised meta-learning, which not only overcomes the problem of small amount and uneven distribution of medical image data, but also does not require sample labeling. Compared with existing methods, it has the advantages of low cost and high classification accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the process of the present invention. DETAILED DESCRIPTION

[0035] The present invention provides a small sample medical image classification method based on unsupervised meta-learning, and its flow chart is as follows: Figure 1 As shown, the following steps are included:

[0036] S1. Acquire medical image data; the medical images include cell images, organ tissue images and CT images.

[0037] S2. Sampling the medical image data obtained in step S1, performing data enhancement on the sampled samples, and then performing image processing to obtain a training data set with pseudo labels, and dividing the training data set into a training set and a validation set, specifically:

[0038] The medical image data obtained in step S1 are randomly sampled to obtain N sample images, and the sample images are automatically enhanced. The same image data is enhanced to obtain image data of the same category. K images are randomly selected from each category as a support set and Q images as a query set. The above sampling steps are repeated in each round to obtain several groups of support sets and query sets as training data sets with pseudo labels. The above method is used to perform sampling and automatic enhancement to obtain a test data set with pseudo labels. The automatic enhancement is specifically as follows: a search space is defined, and there are 16 types of image enhancement in the search space, namely: AutoContrast(0,1), Equalize(0,1), Invert(0,1), Rotate(0,30), Solarize(0,256), SolarizeAdd( 0,110),Color(0.1,1.9),Posterize(0,4),CutoutAbs(0,40),Contrast(0.1,1.9),Brightness(0.1,1.9),Sharpness(0.1,1.9),ShearX(0,0.3),ShearY(0,0.3),TranslateX(0,100),TranslateY(0,100), where the range in brackets is the amplitude value range for image enhancement using the corresponding graphic transformation method. When searching in the search space, the amplitude value is uniformly taken as ii values ​​within the defined range. Each time a data enhancement operation is performed, two enhancement methods are randomly selected from the search space. The total amplitude is xx, which is expressed as follows:

[0039] val=xx×(max-min)+min

[0040] Among them, val is the adjusted parameter; max is the upper limit of the amplitude value before adjustment; min is the lower limit of the amplitude value before adjustment; the training data set is randomly cropped into images of preset pixel size, randomly inverted according to the preset probability, and the brightness, contrast and saturation are offset by the preset amplitude, and finally normalized, and finally divided into training set and validation set; the test data set is randomly cropped into images of preset pixel size, randomly inverted according to the preset probability, and the brightness, contrast and saturation are offset by the preset amplitude, and finally normalized to obtain the test set.

[0041] S3. Based on the basic framework of the prototype network, an initial medical image classification model is constructed, wherein the initial medical image classification model includes a feature extraction module and a similarity calculation module; the feature extraction module includes a first 1×1 convolution kernel, BatchNorm2d, a ReLU layer, a first extraction module, a second extraction module, a third extraction module, a fourth extraction module, a second 1×1 convolution kernel, and an adaptive average pooling module connected in series in sequence; the input data is first processed by the first 1×1 convolution kernel to combine high-level network features with low-level network features; the output result of the first 1×1 convolution kernel is first normalized using BatchNorm2d, and then preliminarily screened by the ReLU layer;

[0042] The output of the ReLU layer is used as the input of the first extraction module; the first to fourth extraction modules have the same structure, including the first 3×3 convolution kernel, the first BatchNorm2d, the first ReLU layer, the second 3×3 convolution kernel, the second BatchNorm2d, and the second ReLU layer connected in series in sequence; the second 1×1 convolution kernel uses the output of the second ReLU layer in the first to fourth extraction modules as input, fuses the features extracted by each extraction module, and then inputs them into the adaptive average pooling module to obtain the model classification result;

[0043] The similarity calculation module adds an adaptive adjustment parameter based on the cosine similarity. The cosine similarity calculation formula is:

[0044]

[0045] During the model training process, is the neutral P of the model n , is the prediction result φ(x) of the model; ||·|| is the modulus of the vector; the present invention introduces the adjustment parameter into the above formula The following half cosine calculation formula is obtained to calculate the category confidence:

[0046]

[0047] Among them, P n is the center point and φ(·) is the prediction result of the model; y i is the pseudo label during model training; n is the number of data categories; x is the feature vector of the input medical image data; x j is the feature vector of the image in the support set; k is the number of images in the support set; sim sns is the half cosine similarity;

[0048] S4. Using the base class data set obtained in step S2, the initial medical image classification model obtained in step S3 is trained to obtain a base class data classification model, specifically:

[0049] Cross entropy loss is used for training, and the loss function is expressed as follows:

[0050]

[0051] Where N is the number of training samples; p i is the probability value of the predicted pixel; y i is the pseudo label for training; M is the total number of categories; c is the number of categories; a group of support sets and query sets are taken as a small batch sampling, and each round of training calculation will calculate the average loss value of at least kk small batch samplings. After training for at least mm rounds, the model parameters with the highest accuracy of the validation set are selected and saved to obtain the classification model of the training set data.

[0052] S5. Use the validation set obtained in step S2 to adjust the training set data classification model obtained in step S4 to obtain a medical image classification model. Specifically, the training set data classification model obtained in S4 is verified on the validation set and trained again; the scalability of the model on new categories is optimized to obtain a medical image classification model; and the medical image classification model is tested using the test set obtained in step S2.

[0053] S6. Using the medical image classification model obtained in step S5, actual medical image classification is performed, specifically comprising the following steps:

[0054] a. Obtain actual medical image data;

[0055] b. Process the medical image data obtained in step a to obtain an image data set, specifically:

[0056] The medical image data obtained in step a is cropped, the image size is changed to a preset pixel, and normalized;

[0057] c. Input the image data set obtained in step b into the medical image classification model obtained in step S5 to obtain the classification result, thereby completing the actual medical image classification.

[0058] If the acquired medical image data is a cell image, the model classification result is the cell type; if the acquired medical image data is an organ tissue image, the model classification result is the organ tissue type; if the acquired medical image data is a CT image, the model classification result is the disease type.

[0059] The method of the present invention is further described below in conjunction with an embodiment:

[0060] Using the method provided by the present invention, the following image classification model is constructed using public medical image data to perform image classification on three data sets: BLOOD (single cell images of 8 types of blood cells), PATHOLOGY (HC-stained tissue slides of patients with colorectal cancer) and CHEST (ChestX-ray8 frontal chest radiographs).

[0061] The existing methods are then used to classify the images of the above three data sets, and the results are shown in Tables 1 to 3.

[0062] Table 1 Classification accuracy of the proposed method and the existing method for the BLOOD data set

[0063]

[0064] Table 2 Classification accuracy of the proposed method and the existing method for PATHOLOGY dataset

[0065]

[0066] Table 3 Classification accuracy of the proposed method and the existing method for the CHEST dataset

[0067]

[0068] It can be seen from the data in the table that the method disclosed in the present invention performs better than the existing methods on these three medical image datasets.

Claims

1. A small sample medical image classification method based on unsupervised meta-learning, characterized in that: The following steps are involved: S1. Acquire medical image data; S2. Sampling the medical image data obtained in step S1, performing data enhancement on the sampled samples, and then performing image processing to obtain a training data set with pseudo labels, and dividing the training data set into a training set and a validation set; S3. Based on the basic framework of the prototype network, build an initial medical image classification model; S4. Using the training set obtained in step S2, the initial medical image classification model obtained in step S3 is trained to obtain a training set data classification model; S5. Using the validation set obtained in step S2, the training set data classification model obtained in step S4 is adjusted to obtain a medical image classification model; S6. Use the medical image classification model obtained in step S5 to perform actual medical image classification.

2. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: The medical images described in step S1 include cell images, organ tissue images and CT images.

3. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: Step S2 specifically includes: randomly sampling the medical image data obtained in step S1 to obtain N sample images, automatically enhancing the sample images, enhancing the same image data to obtain image data of the same category, randomly selecting K images from each category as a support set and Q images as a query set, repeating the above sampling steps in each round to obtain several groups of support sets and query sets as training data sets with pseudo labels; The training dataset with pseudo labels is then randomly cropped into images of a preset pixel size, randomly inverted according to a preset probability, and the brightness, contrast, and saturation are offset by a preset amplitude. Finally, it is normalized and divided equally into a training set and a validation set.

4. The small sample medical image classification method based on unsupervised meta-learning according to claim 3 is characterized in that: The automatic enhancement is specifically as follows: a search space is defined, in which there are 16 types of image enhancement, namely: AutoContrast (0,1), Equalize (0,1), Invert (0,1), Rotate (0,30), Solarize (0,256), SolarizeAdd (0,110), Color (0.1,1.9), Posterize (0,4), CutoutAbs (0,40), Contrast (0.1,1.9), Brightness s(0.1,1.9),Sharpness(0.1,1.9),ShearX(0,0.3),ShearY(0,0.3),TranslateX(0,100),TranslateY(0,100), where the range in brackets is the amplitude range of the image enhancement corresponding to the graphic transformation method. When searching in the search space, the amplitude value is uniformly taken as ii values ​​within the defined range. Each time the data enhancement operation is performed, two enhancement methods are randomly selected from the search space. The total amplitude is xx, which is expressed by the following formula: val=xx×(max-min)+min Among them, val is the adjusted parameter; max is the upper limit of the amplitude value before adjustment; min is the lower limit of the amplitude value before adjustment.

5. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: The initial medical image classification model described in step S3 includes a feature extraction module and a similarity calculation module; the feature extraction module includes a first 1×1 convolution kernel, BatchNorm2d, a ReLU layer, a first extraction module, a second extraction module, a third extraction module, a fourth extraction module, a second 1×1 convolution kernel, and an adaptive average pooling module connected in series in sequence; the input data is first processed by the first 1×1 convolution kernel to combine high-level network features with low-level network features; The output of the first 1×1 convolution kernel is normalized using BatchNorm2d and then preliminarily screened through the ReLU layer; The output of the ReLU layer is used as the input of the first extraction module; the first to fourth extraction modules have the same structure, including the first 3×3 convolution kernel, the first BatchNorm2d, the first ReLU layer, the second 3×3 convolution kernel, the second BatchNorm2d, and the second ReLU layer connected in series in sequence; the second 1×1 convolution kernel uses the output of the second ReLU layer in the first to fourth extraction modules as input, fuses the features extracted by each extraction module, and then inputs them into the adaptive average pooling module to obtain the model classification result; The similarity calculation module is based on the calculation of cosine similarity and calculates the category confidence through the following half cosine calculation formula: Among them, P n is the center point and φ(·) is the prediction result of the model; y i is the pseudo label during model training; n is the number of data categories; x is the feature vector of the input medical image data; x j is the feature vector of the image in the support set; k is the number of images in the support set; sim sns is the half cosine similarity.

6. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: In step S4, cross entropy loss is used for training, and the loss function is expressed as follows: Where N is the number of training samples; p i is the probability value of the predicted pixel; y i is the pseudo label for training; M is the total number of categories; c is the number of categories; a group of support sets and query sets are taken as a small batch sampling, and each round of training calculation will calculate the average loss value of at least kk small batch samplings. After training for at least mm rounds, the model parameters with the highest accuracy of the validation set are selected and saved to obtain the classification model of the training set data.

7. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: In step S5, the training set data classification model obtained in step S4 is verified using the validation set, and trained again to optimize the scalability of the model on new categories, thereby obtaining a medical image classification model.

8. The small sample medical image classification method based on unsupervised meta-learning according to claim 1, characterized in that: The actual medical image classification is performed using the medical image classification model obtained in step S5 in step S6, which specifically includes the following steps: a. Obtain actual medical image data; b. Processing the medical image data obtained in step a to obtain an image data set; c. Input the image data set obtained in step b into the medical image classification model obtained in step S5 to obtain the classification result, thereby completing the actual medical image classification.

9. The small sample medical image classification method based on unsupervised meta-learning according to claim 8, characterized in that: Step b specifically includes: cropping the medical image data obtained in step a, converting the image size to preset pixels, and performing normalization processing.

10. The small sample medical image classification method based on unsupervised meta-learning according to claim 9, characterized in that: If the acquired medical image data is a cell image, the model classification result is the cell type; if the acquired medical image data is an organ tissue image, the model classification result is the organ tissue type; if the acquired medical image data is a CT image, the model classification result is the disease type.

Citation Information

Cited By

  • Small sample medical image classification method and imaging method based on attention mechanism

    CN119649152A

  • Small sample medical image classification method based on attention mechanism and imaging method

    CN119649152B