Medical few-sample classification method based on clustering analysis and local boundary learning

Through the method based on cluster analysis and local boundary learning, the problems of small sample size and irregular category boundary of medical data are solved, and higher classifier accuracy and generalization capabilities are achieved, making it easier to distinguish between few medical samples in the new measurement space.

CN119513742APending Publication Date: 2025-02-25SICHUAN UNIV
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411581840.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The small sample size of medical data, noise, irregular category boundaries and intra-class heterogeneity, lead to low overfitting and generalization capabilities of the model, making it difficult to make reliable predictions on new data samples.

Method used

The medical sample classification method based on cluster analysis and local boundary learning is adopted. By establishing a local boundary learning network model, the DBSCAN clustering algorithm is used to eliminate noise samples, and local boundary learning is carried out to form clear category boundaries to improve the accuracy of the classifier.

Benefits of technology

Effectively learn the nonlinear mapping relationship of few medical samples, find small-scale rule boundaries, improve the accuracy and generalization ability of classifiers, and make it easier to distinguish between few medical samples in the new measurement space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513742A_ABST
    Figure CN119513742A_ABST
Patent Text Reader

Abstract

The invention discloses a medical few-sample classification method based on clustering analysis and local boundary learning, and belongs to the field of medical data classification management, and the method comprises the steps: obtaining a data set of medical few samples, inputting the data set into a local boundary learning network model, carrying out the clustering analysis based on a modified density-based clustering algorithm DBSCAN, and obtaining a data set of the medical few samples; and performing boundary learning based on a local area formed between the clusters, and inputting the medical samples processed by the local boundary learning network model into a classifier to complete classification of the medical samples. According to the method, through clustering analysis and local boundary learning, a small-range rule boundary can be found more conveniently, a clearer category boundary is formed in a sample in a local space, the accuracy of a final classifier is improved, meanwhile, the method is a mode of learning mapping data, medical few samples can be distinguished more easily in a new measurement space, and the accuracy of the final classifier is improved. And the types of the subsequently used classifiers are not influenced, and the expandability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of medical data classification management, and specifically relates to a medical small sample classification method based on cluster analysis and local boundary learning. Background Art

[0002] Some medical institutions lack advanced data management and analysis systems, and the collection and processing efficiency of medical data is low, resulting in a small amount of collected data samples. When using neural networks to model and analyze related diseases, a large number of neurons require more samples to train and adjust, but in reality only a small number of samples can be collected, which is difficult to represent the entire data distribution. Repeated training will cause the model to learn the noise and features in the training data, rather than generalizing to unseen data. Therefore, the small sample problem is prone to overfitting the model and also to low generalization ability of the model. Secondly, medical data may be affected by measurement errors and other noise, which will lead to reduced accuracy and reliability of the data. Some noise samples, irrelevant background information, non-clinical related features, etc. are included in the research data set, which may introduce some deviations that the model cannot learn, affecting the model's learning of the true distribution and decision characteristics of the data samples. These factors lead to reduced accuracy and generalization ability of the model, making it difficult to make reliable predictions on new data samples.

[0003] At the same time, due to the relatively complex pathological mechanisms of some medical problems, the subjectivity of data recording, and the similarity of characteristics between patients, there may be small inter-class variability, which exacerbates the irregularity of category boundaries. For some special medical problems, the same risk factors have different impacts on individuals, making the study of pathological mechanisms more complicated. Some cases have the risk factors and suffer from the disease, while some cases have the risk factors but do not suffer from the disease. In addition, the difficulty of data collection makes the collected case characteristics very limited, and the subjectivity of data recording means that only some indicators based on experience or seemingly more significant are recorded. The limited data and limited features make it impossible for the model to learn this complex pathological mechanism. Therefore, the final model cannot be properly trained and cannot effectively classify and predict the samples.

[0004] In summary, the classification research on some medical samples has problems such as small sample size, data noise, irregular category boundaries and intra-category heterogeneity. Taking pregnancy complications as an example, some serious complications not only affect women's physical health and fetal development, but are also more likely to cause serious adverse pregnancy outcomes and seriously affect maternal and child safety. Early identification and intervention of complications can significantly reduce maternal and infant mortality and other adverse outcomes, and improve maternal and child health. Summary of the invention

[0005] In view of the above-mentioned deficiencies in the prior art, the medical few-sample classification method based on cluster analysis and local boundary learning provided by the present invention solves the problem of binary classification of medical samples with small sample size, noisy data, irregular category boundaries and intra-class heterogeneity in actual situations.

[0006] In order to achieve the above-mentioned invention object, the technical solution adopted by the present invention is: a medical few-sample classification method based on cluster analysis and local boundary learning, comprising the following steps:

[0007] S1: Establish a local boundary learning network model;

[0008] S2: Obtain a dataset of historical medical samples and input it into the local boundary learning network model. Perform clustering analysis using the modified density-based clustering algorithm DBSCAN to obtain several clusters and cluster prototypes.

[0009] S3: Based on several clusters and cluster prototypes, and based on the local areas formed between clusters, boundary learning is performed to obtain a data set with clear boundaries and complete the training of the local boundary learning network model;

[0010] S4: Using the trained local boundary learning network model, the original medical few samples are processed to obtain the processed original medical few samples;

[0011] S5: Input the processed original medical minority samples into the classifier for training, and use the trained classifier to complete the classification of the medical minority samples.

[0012] The beneficial effects of the present invention are as follows: the present invention can effectively learn the nonlinear mapping relationship between a small number of medical samples and labels through a local boundary learning network model, and divide the local space based on the distance and angle between clusters through cluster analysis, so that it can more conveniently find regular boundaries in a small range, and by zooming in and out between samples, the samples in the local space form clearer category boundaries, thereby improving the accuracy of the classifier. At the same time, the algorithm of the local boundary learning network model is a way of learning mapping data, which makes the small number of medical samples easier to distinguish in the new metric space, does not affect the type of classifier used subsequently, and has strong scalability.

[0013] Further: the specific steps of S2 are as follows:

[0014] S201: Obtain a dataset of historical medical samples and input it into a local boundary learning network model, and use a density-based clustering algorithm DBSCAN to divide all samples in the dataset into several clusters and noise samples; the noise samples are samples that do not belong to any cluster among all samples in the dataset;

[0015] S202: Calculate the distance between the noise samples and the non-noise samples in the data set, and divide the noise samples into the cluster where the non-noise samples with the smallest distance are located, eliminate the noise samples, and obtain a number of clusters after the noise samples are eliminated;

[0016] S203: Calculate the center points of several negative samples in the cluster after eliminating noise samples, as the prototypes of the negative samples in the cluster;

[0017] S204: Calculate the center points of several positive samples within the cluster after eliminating noise samples, as the prototypes of the positive samples within the cluster.

[0018] The beneficial effect of the above further scheme is: through the modified density-based clustering algorithm DBSCAN, all samples are divided into different clusters, which facilitates the subsequent more detailed local space division and makes it easier to find small-scale regular boundaries in the local space.

[0019] Further: the specific steps of S3 are as follows:

[0020] S301: according to a plurality of clusters, and based on distance and angle, each cluster is regarded as a central cluster, and a plurality of neighboring clusters of the central cluster are respectively calculated to obtain a plurality of local spaces; the local space is a space where the central cluster and the neighboring clusters are located;

[0021] S302: constructing query samples and support sets in the training set according to a number of local spaces;

[0022] S303: Obtain a close identifier f between the query sample and each sample in the support set according to the prototype of the cluster;

[0023] S304: According to the close identifier f, the distance between the query sample and each sample in the support set is adjusted to complete boundary learning and obtain a data set with clear boundaries.

[0024] The beneficial effect of the above further scheme is that by local boundary learning, the samples are mapped to a new metric space, and the samples are conditionally moved closer and farther away, so that the samples in the local space can form clearer and more accurate boundaries.

[0025] Further: the specific steps of S301 are as follows:

[0026] S3011: According to a number of clusters, any one cluster is selected as a central cluster, and the distances from the center points of clusters other than the central cluster to the center point of the central cluster are calculated and sorted to obtain a distance list of the central cluster;

[0027] S3012: taking the cluster with the smallest distance in the distance list of the central cluster as the first neighbor cluster and including it in the neighbor cluster set of the central cluster;

[0028] S3013: According to the distance list of the center cluster, clusters corresponding to the distances are selected in ascending order, and the angle between the selected cluster and the center of the previous neighbor cluster and the center cluster is calculated;

[0029] S3014: Determine whether the angle calculated in S3013 is greater than a set angle threshold. If so, the selected cluster is used as a neighbor cluster of the central cluster and included in the neighbor cluster set of the central cluster. Otherwise, return to S3013 and select the next cluster in the distance list of the central cluster to calculate the angle.

[0030] S3015: Determine whether the number of neighbor clusters in the neighbor cluster set of the central cluster reaches a set number threshold. If so, obtain the central cluster and the neighbor cluster set of the central cluster, and combine them to obtain the local space of the central cluster. Otherwise, return to S3013.

[0031] S3016: Take several clusters as central clusters respectively, and repeat S3011 to S3016 to obtain the local space of each cluster, that is, several local spaces.

[0032] The beneficial effect of the above further solution is: based on the distance and angle between samples, the neighbor cluster set of the central cluster is found, which can provide a data basis for the subsequent closer and farther distance between samples.

[0033] Further: the specific steps of S303 are as follows:

[0034] According to the prototype of the cluster, it is judged whether the query sample and each sample in the support set meet the condition of shortening the distance between the query sample and the sample in the support set. If so, the shortening identifier f=1 is obtained, otherwise, the shortening identifier f=0 is obtained; wherein,

[0035] The condition for shortening the distance between the query sample and the sample in the support set is: when the query sample and the sample in the support set belong to the same category, and the distance between the prototype of the same category of the cluster where the sample in the support set is located and the query sample is smaller than the distance between the prototype of different categories and the query sample, the distance between the query sample and the support sample is shortened, and the shortening identifier f=1 at this time, otherwise the shortening identifier f=0;

[0036] The conditions for increasing the distance between the query sample and the sample in the support set are: the query sample and the sample in the support set belong to different categories, the query sample and the sample in the support set belong to the same category but the distance between the prototype of the same category of the cluster where the sample in the support set is located and the query sample is greater than the distance between the prototype of different categories and the query sample.

[0037] The beneficial effect of the above further scheme is: according to the set conditions, the close identifiers of the query sample and the samples in the support set are determined, laying the foundation for the subsequent boundary learning of close and far.

[0038] Further: the distance between the query sample and each sample in the support set is adjusted according to the close identifier f, boundary learning is completed, and a data set with clear boundaries is obtained. The specific implementation method is as follows:

[0039] If the close identifier f of the query sample and the sample in the support set is 1, the distance between the query sample and the sample in the support set is reduced to shorten the distance;

[0040] If the close identifier f of the query sample and the sample in the support set is 0, the distance between the query sample and the sample in the support set is enlarged to increase the distance;

[0041] After the distance is shortened and increased, the loss function of the query sample and each sample in the support set is calculated, and the distance between the query sample and each sample in the support set is adjusted by minimizing the loss function to complete the training of the local boundary learning network model.

[0042] The distance extension includes: enlarging the distance between the query sample and the sample in the support set, and maximizing the distance between the optimal decision boundary and the sample point; the optimal decision boundary is the average distance between the sample in the support set and the similar neighboring samples.

[0043] The beneficial effect of the above further scheme is: according to the set zooming-in condition and zooming-out condition, the samples are zoomed in and zoomed out, so that samples of the same type but different clusters are close to each other and away from samples of different types, forming a clearer category boundary.

[0044] Furthermore: the expression of the loss function is as follows:

[0045]

[0046] Among them, L is the loss function, N S is the number of samples in the support set, f is the close identifier, and x q is the query sample, x q represents the query sample, x i is the i-th sample in the query set, μ is an adjustable parameter, and d qm For the query sample x q The average distance to similar neighbor samples, M is the distance between samples and the average distance d when the samples are to be pulled away gm The smallest difference, [z] + max(0,z), z is the formula, and max is the maximum value.

[0047] The beneficial effect of the above further scheme is: through the loss function, the loss of the local boundary learning model in one round is calculated, which is convenient for subsequent judgment of the learning progress of the local boundary learning model. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 This is a flowchart of a medical few-sample classification method based on cluster analysis and local boundary learning. DETAILED DESCRIPTION

[0049] The specific implementation modes of the present invention are described below so that those skilled in the art can understand the present invention. However, it should be clear that the present invention is not limited to the scope of the specific implementation modes. For those of ordinary skill in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the attached claims, these changes are obvious, and all inventions and creations utilizing the concept of the present invention are protected.

[0050] For ease of description, the sample in the present invention refers to the data of a case. A data set contains data of multiple cases. Negative samples are used to replace samples describing normal, non-diseased samples, and positive samples are used to replace samples describing diseased samples.

[0051] like Figure 1 As shown, a medical few-sample classification method based on cluster analysis and local boundary learning includes the following steps:

[0052] S1: Establish a local boundary learning network model;

[0053] S2: Obtain a dataset of historical medical samples and input it into the local boundary learning network model. Perform clustering analysis using the modified density-based clustering algorithm DBSCAN to obtain several clusters and cluster prototypes.

[0054] S3: Based on several clusters and cluster prototypes, and based on the local areas formed between clusters, boundary learning is performed to obtain a data set with clear boundaries and complete the training of the local boundary learning network model;

[0055] S4: Using the trained local boundary learning network model, the original medical few samples are processed to obtain the processed original medical few samples;

[0056] S5: Input the processed original medical minority samples into the classifier for training, and use the trained classifier to complete the classification of the medical minority samples.

[0057] In one embodiment of the present invention, the local boundary learning network model in S1 is used to perform local boundary learning of medical few samples, with the purpose of mapping the original medical few samples to a new metric space so that the boundaries of the original medical few samples in the new metric space are more obvious and more separable; and the local boundary learning network model does not require a complex network structure to perform boundary learning, and an ordinary fully connected neural network can be used for boundary learning.

[0058] In one embodiment of the present invention, the specific steps of S2 are as follows:

[0059] S201: Obtain a dataset of historical medical samples and input it into a local boundary learning network model, and use a density-based clustering algorithm DBSCAN to divide all samples in the dataset into several clusters and noise samples; the noise samples are samples that do not belong to any cluster among all samples in the dataset;

[0060] S202: Calculate the distance between the noise samples and the non-noise samples in the data set, and divide the noise samples into the clusters where the non-noise samples with the smallest distance to them are located, eliminate the noise samples, and obtain several clusters after eliminating the noise samples; S202 is a modification based on the original density-based clustering algorithm DBSCAN, and an additional step is performed: divide the noise samples into the clusters where the non-noise samples with the smallest distance to them are located, and classify the noise samples;

[0061] S203: Calculate the center points of several negative samples in the cluster after eliminating noise samples, as the prototype of the negative samples in the cluster; wherein the center points of the negative samples in the cluster are calculated by the sample mean;

[0062] S204: Calculate the center points of several positive samples in the cluster after eliminating noise samples, as the prototype of the positive samples in the cluster, wherein the center points of the positive samples in the cluster are calculated by the sample mean.

[0063] In one embodiment of the present invention, based on cluster analysis, the entire data set is described as:

[0064]

[0065]

[0066] in, is the data set, x j is the D-dimensional feature of the sample, y j ∈{0, 1} is the class label of the jth sample, 0 represents the negative sample class, 1 represents the positive sample class, c j ∈{1,…,K} is the cluster label of the sample after cluster analysis, K is the number of clusters divided after adaptive clustering, n jFor c j The center of negative samples in each cluster, p j For c j The center of the positive samples in each cluster;

[0067] The specific formula for calculating the center point is as follows:

[0068]

[0069] Among them, G is the center point, t is the number of samples to be calculated, and m is a natural number. When calculating the center point of positive samples, t is the number of positive samples in the cluster, and x m is the mth positive sample in the cluster; when calculating the center point of negative samples, t is the number of negative samples in the cluster, x m is the mth negative sample in the cluster.

[0070] In one embodiment of the present invention, the specific steps of S3 are as follows:

[0071] S301: according to a plurality of clusters, and based on distance and angle, each cluster is regarded as a central cluster, and a plurality of neighboring clusters of the central cluster are respectively calculated to obtain a plurality of local spaces; the local space is a space where the central cluster and the neighboring clusters are located;

[0072] S302: constructing query samples and support sets in the training set according to a number of local spaces;

[0073] S303: Obtain a close identifier f between the query sample and each sample in the support set according to the prototype of the cluster;

[0074] S304: According to the close identifier f, the distance between the query sample and each sample in the support set is adjusted to complete boundary learning and obtain a data set with clear boundaries.

[0075] The specific steps of S301 are as follows:

[0076] S3011: According to a number of clusters, any one cluster is selected as a central cluster, and the distances from the center points of clusters other than the central cluster to the center point of the central cluster are calculated and sorted to obtain a distance list of the central cluster;

[0077] S3012: taking the cluster with the smallest distance in the distance list of the central cluster as the first neighbor cluster and including it in the neighbor cluster set of the central cluster;

[0078] S3013: According to the distance list of the center cluster, clusters corresponding to the distances are selected in ascending order, and the angle between the selected cluster and the center of the previous neighbor cluster and the center cluster is calculated;

[0079] S3014: Determine whether the angle calculated in S3013 is greater than a set angle threshold. If so, the selected cluster is used as a neighbor cluster of the central cluster and included in the neighbor cluster set of the central cluster. Otherwise, return to S3013 and select the next cluster in the distance list of the central cluster to calculate the angle.

[0080] S3015: Determine whether the number of neighbor clusters in the neighbor cluster set of the central cluster reaches a set number threshold. If so, obtain the central cluster and the neighbor cluster set of the central cluster, and combine them to obtain the local space of the central cluster. Otherwise, return to S3013.

[0081] S3016: Take several clusters as central clusters respectively, and repeat S3011 to S3016 to obtain the local space of each cluster, that is, several local spaces.

[0082] In one embodiment of the present invention, the specific steps of S303 are as follows:

[0083] According to the prototype of the cluster, it is judged whether the query sample and each sample in the support set meet the condition of shortening the distance between the query sample and the sample in the support set. If so, the shortening identifier f=1 is obtained, otherwise, the shortening identifier f=0 is obtained; wherein,

[0084] The condition for shortening the distance between the query sample and the sample in the support set is: when the query sample and the sample in the support set belong to the same category, and the distance between the prototype of the same category and the query sample in the cluster where the sample in the support set is located is smaller than the distance between the prototype of different categories and the query sample, the distance between the query sample and the support sample is shortened, and the shortening identifier f=1, otherwise the shortening identifier f=0;

[0085] The conditions for increasing the distance between the query sample and the sample in the support set are: the query sample and the sample in the support set belong to different categories, the query sample and the sample in the support set belong to the same category but the distance between the prototype of the same category and the query sample in the cluster where the sample in the support set is located is greater than the distance between the prototype of different categories and the query sample. The distance between samples can be calculated by the following formula:

[0086] d(x i , x j )=||x i -x j ||2

[0087] Among them, d(x i , x j ) is the sample x i and sample x j The distance between them, ||||2 is the Euclidean norm.

[0088] In one embodiment of the present invention, in S304, according to the close identifier f, the distance between the query sample and each sample in the support set is adjusted to complete the boundary learning and obtain a data set with clear boundaries. The specific implementation method is as follows:

[0089] Now assume that x1 is a sample in the support set and x2 is a sample in the query set:

[0090] If the close identifier f of the query sample x2 and the sample x1 in the support set is 1, the distance d between the query sample and the sample in the support set is reduced. 12 =||x1-x2||2, to shorten the distance;

[0091] If the close identifier f of the query sample x2 and the sample x1 in the support set is 0, the distance d between the query sample and the sample in the support set is enlarged. 12 =||x1-x2||2, to increase the distance; increasing the distance includes: increasing the distance between the query sample x2 and the sample x1 in the support set, and maximizing the distance between the optimal decision boundary and the sample point, where the optimal decision boundary is the average distance between the sample x1 in the support set and the similar neighboring samples, set to d 1m , and its calculation expression is as follows:

[0092]

[0093] X′={x′ 11 , …, x′ 1v}

[0094] Among them, X' is the N closest to x1 x The set of samples of the same category as x1 among the samples, x′ 1v is the N closest to x1 x The samples of the same category as x1 in the samples, v is the subscript, representing the number of elements in X′.

[0095] After closing and closing the distance, the loss function of the query sample and each sample in the support set is calculated. The distance adjustment between the query sample and each sample in the support set is achieved by minimizing the loss function to complete the training of the local boundary learning network model. The expression of the loss function is as follows:

[0096]

[0097] Among them, L is the loss function, N S is the number of samples in the support set, f is the close identifier, and x q is the query sample, x q represents the query sample, x i is the i-th sample in the query set, μ is an adjustable parameter, and d qmFor the query sample x q The average distance to similar neighbor samples, M is the distance between samples and the average distance d when the samples are to be pulled away qm The smallest difference, [z] + max(0,z), z is the formula, and max is the maximum value.

[0098] In one embodiment of the present invention, the network model is trained for multiple rounds, each round of training includes multiple rounds, and each round constructs a query sample and a support set, so that the network model can perform boundary learning in a local space; the loss L is calculated according to the loss function, and then the parameters of the network model are updated through back propagation, so that the finally learned network model can map all samples to the new metric space to form clearer category boundaries.

[0099] In one embodiment of the present invention, the original medical few samples are mapped to a new metric space using a trained local boundary learning network model, and then the classifier is learned in the new metric space to distinguish the samples, thereby improving the accuracy and overall performance of the classifier, and finally completing the training of the classifier, and then using the classifier to classify the medical few sample data.

[0100] All training set samples are input into the network model for mapping, and a classifier is trained using the mapped training set to improve the classifier's ability to distinguish between positive and negative samples and improve the overall performance of the model. The classifier includes but is not limited to nonlinear classifiers such as neural network models and decision trees.

[0101] The beneficial effects of the present invention are as follows: the present invention can effectively learn the nonlinear mapping relationship between a small number of medical samples and labels through a local boundary learning network model without complex prior knowledge, and divide the local space based on the distance and angle between clusters through cluster analysis, so that it can more conveniently find small-scale regular boundaries, and by zooming in and out between samples, the samples in the local space form clearer category boundaries, thereby improving the accuracy of the classifier. At the same time, the algorithm of the local boundary learning network model is a way of learning mapping data, which makes the small number of medical samples easier to distinguish in the new metric space, does not affect the type of classifier used subsequently, and has strong scalability.

Claims

1. A medical few-sample classification method based on cluster analysis and local boundary learning, characterized in that: The following steps are involved: S1: Establish a local boundary learning network model; S2: Obtain a dataset of historical medical samples and input it into the local boundary learning network model. Perform clustering analysis using the modified density-based clustering algorithm DBSCAN to obtain several clusters and cluster prototypes. S3: Based on several clusters and cluster prototypes, and based on the local areas formed between clusters, boundary learning is performed to obtain a data set with clear boundaries and complete the training of the local boundary learning network model; S4: Using the trained local boundary learning network model, the original medical few samples are processed to obtain the processed original medical few samples; S5: Input the processed original medical minority samples into the classifier for training, and use the trained classifier to complete the classification of the medical minority samples.

2. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 1, characterized in that: The specific steps of S2 are as follows: S201: Obtain a dataset of historical medical samples and input it into a local boundary learning network model, and use a density-based clustering algorithm DBSCAN to divide all samples in the dataset into several clusters and noise samples; the noise samples are samples that do not belong to any cluster among all samples in the dataset; S202: Calculate the distance between the noise samples and the non-noise samples in the data set, and divide the noise samples into the cluster where the non-noise samples with the smallest distance are located, eliminate the noise samples, and obtain a number of clusters after the noise samples are eliminated; S203: Calculate the center points of several negative samples in the cluster after eliminating noise samples, as the prototypes of the negative samples in the cluster; S204: Calculate the center points of several positive samples within the cluster after eliminating noise samples, as the prototypes of the positive samples within the cluster.

3. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 1, characterized in that: The specific steps of S3 are as follows: S301: according to a plurality of clusters, and based on distance and angle, each cluster is regarded as a central cluster, and a plurality of neighboring clusters of the central cluster are respectively calculated to obtain a plurality of local spaces; the local space is a space where the central cluster and the neighboring clusters are located; S302: constructing query samples and support sets in the training set according to a number of local spaces; S303: Obtain a close identifier f between the query sample and each sample in the support set according to the prototype of the cluster; S304: According to the close identifier f, the distance between the query sample and each sample in the support set is adjusted to complete the boundary learning, obtain a data set with clear boundaries, and complete the training of the local boundary learning network model.

4. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 3 is characterized in that: The specific steps of S301 are as follows: S3011: According to a number of clusters, any one cluster is selected as a central cluster, and the distances from the center points of clusters other than the central cluster to the center point of the central cluster are calculated and sorted to obtain a distance list of the central cluster; S3012: taking the cluster with the smallest distance in the distance list of the central cluster as the first neighbor cluster and including it in the neighbor cluster set of the central cluster; S3013: According to the distance list of the center cluster, clusters corresponding to the distances are selected in ascending order, and the angle between the selected cluster and the center of the previous neighbor cluster and the center cluster is calculated; S3014: Determine whether the angle calculated in S3013 is greater than a set angle threshold. If so, the selected cluster is used as a neighbor cluster of the central cluster and included in the neighbor cluster set of the central cluster. Otherwise, return to S3013 and select the next cluster in the distance list of the central cluster to calculate the angle. S3015: Determine whether the number of neighbor clusters in the neighbor cluster set of the central cluster reaches a set number threshold. If so, obtain the central cluster and the neighbor cluster set of the central cluster, and combine them to obtain the local space of the central cluster. Otherwise, return to S3013. S3016: Take several clusters as central clusters respectively, and repeat S3011 to S3016 to obtain the local space of each cluster, that is, several local spaces.

5. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 3, characterized in that: The specific steps of S303 are as follows: According to the prototype of the cluster, it is judged whether the query sample and each sample in the support set meet the condition of shortening the distance between the query sample and the sample in the support set. If so, the shortening identifier f=1 is obtained, otherwise, the shortening identifier f=0 is obtained; wherein, The condition for shortening the distance between the query sample and the sample in the support set is: when the query sample and the sample in the support set belong to the same category, and the distance between the prototype of the same category of the cluster where the sample in the support set is located and the query sample is smaller than the distance between the prototype of different categories and the query sample, the distance between the query sample and the support sample is shortened, and the shortening identifier f=1 at this time, otherwise the shortening identifier f=0; The conditions for increasing the distance between the query sample and the sample in the support set are: the query sample and the sample in the support set belong to different categories, the query sample and the sample in the support set belong to the same category but the distance between the prototype of the same category of the cluster where the sample in the support set is located and the query sample is greater than the distance between the prototype of different categories and the query sample.

6. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 3, characterized in that: According to the close identifier f, the distance between the query sample and each sample in the support set is adjusted to complete the boundary learning, obtain a data set with clear boundaries, and complete the training of the local boundary learning network model. The specific implementation method is as follows: If the close identifier f of the query sample and the sample in the support set is 1, the distance between the query sample and the sample in the support set is reduced to shorten the distance; If the close identifier f of the query sample and the sample in the support set is 0, the distance between the query sample and the sample in the support set is enlarged to increase the distance; After closing and closing the distance, the loss function of the query sample and each sample in the support set is calculated. The distance adjustment between the query sample and each sample in the support set is achieved by minimizing the loss function to complete the training of the local boundary learning network model. The distance extension includes: enlarging the distance between the query sample and the sample in the support set, and maximizing the distance between the optimal decision boundary and the sample point; the optimal decision boundary is the average distance between the sample in the support set and the similar neighboring samples.

7. The medical few-sample classification method based on cluster analysis and local boundary learning according to claim 6, characterized in that: The expression of the loss function is as follows: Among them, L is the loss function, N S is the number of samples in the support set, f is the close identifier, and x q is the query sample, x q represents the query sample, x i is the i-th sample in the query set, μ is an adjustable parameter, and d qm For the query sample x q The average distance to similar neighbor samples, M is the distance between samples and the average distance d when the samples are to be pulled away qm The smallest difference, [z] + max(0,z), z is the formula, and max is the maximum value.

Citation Information

Patent Citations

  • Classification method based on improved DBSCAN-SMOTE algorithm

    CN105930856A

  • Density-based unbalanced data hybrid sampling algorithm

    CN113378987A

  • Multi-modal model optimization retrieval training method and storage medium

    CN118094216A

  • Method of Automatic Clustering of Objects

    RU2014130519A

  • Remote sensing identification method for agricultural planting structure

    WO2022214039A1