Method for multi-classification of mammary gland pathology images under class imbalance

By introducing angular-margin Mixup and Ghost-Residual structures into breast cancer pathological image classification, the class imbalance problem is solved, the accuracy and robustness of the model are improved, and more effective feature extraction and classification effects are achieved.

CN118736284AInactive Publication Date: 2024-10-01HUBEI UNIV OF TECH
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202410767454.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-14
Publication Date
2024-10-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has a class imbalance problem in the classification of breast cancer pathological images, which leads to overfitting and insufficient model robustness, making it difficult to effectively distinguish the features of the majority class and the minority class.

Method used

The angular-margin Mixup (AMMixup) method and Ghost-Residual structure are used to increase the angular margin between the majority class and the minority class through improved monotonic decreasing function and cross-entropy loss function, and reduce redundant features to improve the model's performance. Inter-class distance and intra-class compactness.

Benefits of technology

It improves the accuracy and robustness of the breast cancer pathology image classification model, reduces the risk of over-fitting, enhances the model's ability to handle imbalanced data sets, and improves the classification effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118736284A_ABST
    Figure CN118736284A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of intelligent medical treatment, and provides a mammary gland pathological image multi-classification method under class imbalance, which comprises the following steps: acquiring a mammary gland pathological image data set with known class information and labels; an improved residual structure Ghost-Residual is added to a ResNet network, an improved ResNet GR minority category classification network is constructed, and a cross entropy loss function L-softmax loss of the angle of learning features is added; a pathological image classification model is obtained based on the proposed AMMixup algorithm and ResNetGR network training; and inputting the enhanced data set into a pathological image classification model to obtain an identification result of each subtype of breast cancer. According to the breast cancer pathology image classification method, the idea of the angle-edge distance between the categories is introduced into Mixup, and the proposed breast cancer pathology image classification model fully combines the advantages of deep learning and oversampling, so that the breast cancer pathology image classification model not only can cope with classification tasks of a small number of categories, but also is easier to classify and higher in recognition precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of intelligent medical care, and in particular to a method for multi-classification of breast pathology images under category imbalance. Background Art

[0002] Among various cancers, breast cancer has always been one of the most common malignant tumors, and its mortality rate is extremely high, posing a serious threat to women's health and happiness. In order to effectively prevent and treat breast cancer and reduce its mortality rate, in addition to developing good living and eating habits, early diagnosis and treatment of breast cancer are still the most important means. When the causes and prevention measures of breast cancer are still unclear, early detection and diagnosis are the most effective ways to improve the cure rate and reduce the mortality rate of patients. Therefore, the intelligent breast cancer classification method using deep learning methods is of great significance to women's health.

[0003] In recent years, with the rapid development of computer vision technology, image processing technology and diagnostic technology, the research on breast cancer pathology image classification methods has emerged. The prior art proposes "a breast cancer pathology image classification method based on deep feature aggregation", which improves the accuracy and robustness of breast cancer pathology image classification by optimizing the combination of feature extraction modules, aggregating deep features and using voting modules. The prior art also proposes "an end-to-end tissue pathology image classification method based on attention pooling", which uses a deep learning model to sample the scores of tissue pathology sections to form a data set, and then uses an end-to-end attention pooling network for classification, which effectively improves the accuracy of diagnosis. The prior art also proposes "a multimodal breast cancer classification training method and system based on graph attention network", which combines the features of three modalities of image, text and pathology to classify breast cancer. The performance of the proposed network structure is better than that of a single modality method, achieving the purpose of improving the accuracy of breast cancer classification.

[0004] The above-mentioned prior art is a method for classifying breast cancer pathology images based on deep learning, but in actual clinical applications, the problem of unbalanced collected data will be encountered, and it will be difficult to meet the requirements of category balance. In order to avoid overfitting caused by skewed data distribution, thereby affecting the training effect of deep learning, algorithms and models that solve category imbalance in classification have emerged in recent years. In the prior art, "a multi-task classification method and system for breast cancer images based on unbalanced data" uses a balanced loss function to process different numbers of breast cancer categories, balances the model's learning ability for different numbers of categories, and achieves feature extraction accuracy. In the prior art, "a method for detecting cancer areas in breast cancer pathology sections based on deep learning" systematically uses a real-time oversampling method with equal probability of categories and a variety of reasonable data enhancement methods on medical disease images to solve the problems of data imbalance and small amounts of data in benign and carcinoma in situ categories.

[0005] In the above-mentioned techniques, the use of balanced loss functions can increase the weight of minority classes to ensure their number, but at the same time the loss function is very sensitive to minority classes, and the direction of gradient updates is easily dominated by minority classes, which is not robust. Although the oversampling method can balance the distribution of categories and thus improve the accuracy of the model, it can also lead to overfitting, especially real-time oversampling, because the generated samples may be different from the real samples, resulting in a shift in the sample distribution, resulting in a decline in performance on some disease classes, making the network performance worse.

[0006] To sum up the above discussion, considering the complexity and multi-category of pathological images, how to overcome the shortcomings of the existing technology and invent a sampling method suitable for breast cancer pathological images, increase the inter-class distance, make the intra-class features more compact, and combine it with a deep learning model is a key problem that needs to be solved urgently in this field. Summary of the invention

[0007] Based on the technical problems existing in the background technology, one of the purposes of the present invention is to propose an angular-marginMixup (AMMixup) method, and to design a new monotonically decreasing function formula to replace the λ~beta(α,α) mixing coefficient in the original Mixup formula, so as to more clearly expand the uneven boundary between the majority class and the minority class. The second purpose of the present invention is to provide a new residual structure Ghost-Residual (denoted as GR structure) to be fused with ResNet, thereby reducing redundant features.

[0008] In view of this, the present invention proposes a method for multi-classification of breast pathology images under category imbalance, which adopts the following technical scheme, including:

[0009] S1: Obtain a breast pathology image dataset with known category information and labels, and preprocess it to achieve model training, verification, and testing;

[0010] S2: Based on ResNet, the residual structure Ghost-Residual is used to build the ResNet_GR network to reduce feature redundancy.

[0011] S3: Send the image preprocessed in step S1 to the ResNet_GR network for training, and then save its weights as a pre-training model. During the training process, the cross entropy loss function L-softmax loss is used to increase the angular margins between image categories to obtain the enhanced data set D;

[0012] S4: Use the pre-trained model and data set D in step S3 and the AMMixup algorithm to establish and train a pathological image classification model, generate new training samples, and introduce an improved monotone decreasing function formula to make the angular margins between mixed image categories more separated;

[0013] S5: using the enhanced data set D in step S3 and the data set consisting of the new training samples in step S4 as input, training and verifying the pathological image classification model to obtain a trained classification model;

[0014] S6: Use the trained classification model to test the test set and output the classification results through the activation function.

[0015] Further, step S1 includes:

[0016] S1-1. Breast pathology image preprocessing:

[0017] Specifically, the image is randomly flipped horizontally, rotated left and right, randomly cropped and scaled, pixel values ​​are normalized, and the data is converted into Tensor form;

[0018] S1-2. Constructing a breast pathology image dataset:

[0019] Specifically, the images after the above preprocessing are divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0020] Further, step S2 includes:

[0021] S2-1, ResNet convolutional neural network feature extraction residual module:

[0022] Specifically, the input image will first be convolved and pooled in the backbone network to achieve feature extraction. The residual structure is used in each module of the original deep residual network ResNet. The residual structure consists of residual and identity mapping. The residual is first reduced in dimension by 1×1 convolution, then feature extracted by 3×3 convolution, and finally increased in dimension by 1×1 convolution. Normalization and Relu function are also used in the convolution process to increase nonlinearity. The identity mapping uses 256 1×1 convolutions to be consistent with the output dimension of the residual to achieve addition. This residual module greatly reduces the number of parameters and calculations required for using only 3×3 convolution.

[0023] S2-2, Ghost module:

[0024] The core idea of ​​Ghost is to introduce the concept of a "ghost channel". In the traditional convolution operation, each channel of the input feature map will generate a channel of the output feature map, while in the Ghost module, each input channel will generate multiple output channels, some of which are called "ghost channels". These "ghost channels" are obtained by linear transformation of the input channels, and their computational cost is low;

[0025] The Ghost module adds more feature expression capabilities without introducing too much computation and storage overhead, which can improve the accuracy and feature extraction capabilities of the model;

[0026] S2-3. Ghost-Residual structure of breast pathology image classification model:

[0027] Specifically, in the residual structure, the 1×1 dimension increase operation will generate a large number of similar feature maps. There is a large redundancy between these feature maps, and the degree of redundancy is also related to the number of categories of the classification task. The more categories there are, the more effective feature maps are required. For the 8-classification task of breast pathology images, the residual structure of ResNet will inevitably generate a large number of redundant feature maps. These redundant feature maps increase the number of model parameters and the amount of calculation, which wastes computing resources. Therefore, the present invention uses the Ghost module to propose a Ghost-Residual structure;

[0028] The Ghost-Residual structure replaces the 256 1×1 convolutions in the original residual block with the Ghost module. The Ghost module not only reduces the amount of calculation and parameters of the dimensionality increase operation, but also improves the efficiency and accuracy when facing the 8-classification task of breast pathology images.

[0029] Specifically, the Ghost-Residual structure is as follows: the convolution layer in the ResNet-50 convolutional neural network convolves the input image to generate a set of feature maps. After visualizing the feature maps generated by the first residual module, some similar feature map pairs can be seen. The Ghost module performs linear operations on one of the feature maps generated by ordinary convolution to obtain its similar feature maps. Assuming that the convolution generates a feature map with n channels, the ordinary convolution generates g′ with l channels. x intrinsic feature map, then the “ghost channel” is obtained by linear operation, according to g′ x Generate s ghost feature maps, the formula is:

[0030]

[0031] in, It is a linear operation. The feature map of the xth channel is linearly operated to obtain the yth ghost feature map g xy ; l is the number of channels of the initial feature map; s is the expansion multiple, that is, each channel of the initial feature map can generate multiple new feature maps through linear transformation; the reason why y is at most s-1 is that the initial l-channel feature map needs to be retained, so the number of feature map channels finally obtained can be n=l·s, that is, each channel is expanded to s times the original.

[0032] Furthermore, the cross entropy loss function L-softmax loss in step S3 is:

[0033] In the softmax function, the output of the CNN feature extraction module is its input. Assume that x t is the eigenvector of the tth group of input, W c is the weight of the cth class, b c represents the bias. Then the input f c The definition is as follows:

[0034] f c =W c T x t +b c #(3)

[0035] Further, through the cosine formula transformation, we can get the following f c :

[0036] f c =||W c ||||x t ||cos(θ c )+b c #(4)

[0037] where θ c ∈[0,π] is x t and W c The angle between ||W c ||, making it equal to 1, and at the same time let the bias b c Set to 0, that is:

[0038] f c =||x t ||cos(θ c )#(5)

[0039] That is to say, the decision boundary of the category is largely determined by the angle, that is, assuming that the decision boundary between category 1 and category 2 is ||x t ||[(cos(θ1)-cos(θ2)]=0, assuming x t Belongs to category 1, so in order to ensure the correct classification, we have ||xt ||cos(θ1)>||x t ||cos(θ2), that is, when cos(θ1)≥cos(θ2), input x t is classified as class 1; when cos(θ1)<cos(θ2), input x t It is classified into 2 categories;

[0040] Furthermore, in order to make the distance between classes more compact, large margin softmax proposes to use a margin positive integer m to constrain the angle, making the angle smaller, that is, the class is more compact and the classes are more separated. At the same time, in order to implement it in the neural network, the cos function is optimized, and the improved formula is as follows:

[0041] f c =||x t ||ψ(θ c )#(6)

[0042] Therefore, the cross entropy loss function L-softmax loss is:

[0043]

[0044] The tth group of input features x t , the corresponding label is z t ,

[0045]

[0046] kπ is an integer multiple of π, k is a constant, a positive integer; m ≥ 1 and is an integer, m controls the gap between categories. The larger m is, the more obvious the dispersion between samples of different categories is, and the larger the angular margin is. At the same time, samples belonging to the same category are increasingly clustered together as m increases.

[0047] Further, step S4 includes:

[0048] S4-1, Mixup algorithm:

[0049] In neural networks, one of the most famous data augmentation techniques for image classification problems is Mixup, which synthesizes training samples through simple linear combinations, as shown below:

[0050]

[0051]

[0052] Where (x i ,y i ) and (x j ,y j) are two samples uniformly sampled from the training set and λ∈[0,1], are synthetic training samples, is the label of the synthetic training sample;

[0053] S4-2, AMMixup method:

[0054] Furthermore, the proposed angular-margin Mixup (AMMixup) method formula is:

[0055]

[0056]

[0057] In order to optimize Mixup, λ is constructed y The formula is used to reduce the angular margin between the same type of image features and increase the angular margin between the different types of image features;

[0058] where λ x The same as that obtained in the original Mixup, and the λ of the mixed sample y According to the following formula, λ y ∈[0,1]:

[0059]

[0060] Among them, θ c1 and θ c2 Represents the input feature vector x t The angle with the weight of the corresponding category, m ≥ 1 and is a positive integer, ψ(θ c ) The specific formula of the monotonically decreasing function is shown in step S3. Therefore, the proposed AMMixup is Get mixed input, through Get the mixed label and get λ by the proposed formula y ;

[0061] The overall idea shows when AMMixup accurately divides synthetic labels into corresponding categories, making the intra-class differences between synthetic images smaller and the inter-class differences larger. This allows the model to further learn the feature perspective and learn discriminative features, making it easier to classify images under imbalanced categories.

[0062] Furthermore, in step S5, the classification model is trained using the PReLU activation function and weight decay regularization.

[0063] Compared with the prior art, the present invention has the following beneficial effects:

[0064] The AMMixup method is provided, and a new formula of a monotonically decreasing function is designed to replace the λ~beta(α,α) mixing coefficient in the original Mixup formula. The purpose is to introduce the angular margin idea by applying a resampling scheme, provide a specific formula for the label of the mixed sample in Mixup, minimize the intra-class margin in the prediction and expand the inter-class margin. The classification model obtains the angle between the feature vector and the weight vector, and obtains the classification angular margin. The angular margin reflects the similarities and differences between different categories. By adjusting the angular margin, the constructed pathological image classification model is easier to classify under imbalanced categories. The generated mixed samples are added to the breast pathology image dataset to expand the dataset, solve the problem of the small number of samples in the dataset, make the trained classification model less biased, and improve the accuracy of the classification model.

[0065] It provides a fusion of Ghost-Residual structure and ResNet, combined with the task of 8 classifications of breast pathology images, to reduce the excessive similar feature maps in the original residual block, effectively suppress the acquisition of redundant information, reduce the number of parameters, and improve the convergence speed of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the examples of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:

[0067] Figure 1 A flow chart of a method for classifying breast pathology images provided in one embodiment of the present invention.

[0068] Figure 2 A breast pathology image classification model provided by an embodiment of the present invention.

[0069] Figure 3 A diagram of the Ghost-Residual1 (GR1) structure provided in accordance with an embodiment of the present invention.

[0070] Figure 4 A diagram of the Ghost-Residual2 (GR2) structure provided in accordance with an embodiment of the present invention. DETAILED DESCRIPTION

[0071] In order to facilitate the understanding of those skilled in the art, the present invention is further described in detail below in conjunction with specific examples. The following specific examples are only used to illustrate the present invention, rather than all examples, and should not be considered to limit the scope of the present invention.

[0072] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present disclosure. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present disclosure belongs.

[0073] like Figure 1 As shown, this embodiment provides a method for multi-classification of breast pathology images under class imbalance. The present invention uses the BreakHis breast cancer tissue pathology image dataset as an example dataset, which consists of 7909 700×460 color images of 82 patients, including 2480 benign tumor samples and 5429 malignant tumor samples. The benign and malignant images have visual magnifications of 40×, 100×, 200× and 400×, respectively, and also include eight specific breast cancer subtypes at four independent magnifications. The specific implementation includes the following steps:

[0074] S1: Obtain the BreakHis breast cancer histopathology image dataset and preprocess it to train, validate, and test the model. The specific steps are as follows:

[0075] S1-1. Breast pathology image preprocessing:

[0076] Specifically, the image is randomly flipped horizontally, rotated left and right, randomly cropped and scaled, pixel values ​​are normalized, and the data is converted into Tensor format. To adapt to the ResNet-50 convolutional neural network, the input breast cancer tissue pathology image is scaled to a 224×224 size image;

[0077] S1-2. Constructing a breast pathology image dataset:

[0078] Specifically, the images after the above preprocessing are divided into a training set, a validation set, and a test set in a ratio of 8:1:1.

[0079] S2: Based on ResNet, the residual structure Ghost-Residual is used to build the ResNet_GR network to reduce feature redundancy.

[0080] Further, step S2 includes:

[0081] S2-1, ResNet convolutional neural network feature extraction residual module:

[0082] Specifically, the input image will first be convolved and pooled in the backbone network to achieve feature extraction. The residual structure is used in each module of the original deep residual network ResNet. The residual structure consists of residual and identity mapping. The residual is first reduced in dimension by 1×1 convolution, then feature extracted by 3×3 convolution, and finally increased in dimension by 1×1 convolution. Normalization and Relu function are also used in the convolution process to increase nonlinearity. The identity mapping uses 256 1×1 convolutions to be consistent with the output dimension of the residual to achieve addition. This residual module greatly reduces the number of parameters and calculations required for using only 3×3 convolution.

[0083] S2-2, Ghost module:

[0084] The core idea of ​​Ghost is to introduce the concept of a "ghost channel". In the traditional convolution operation, each channel of the input feature map will generate a channel of the output feature map, while in the Ghost module, each input channel will generate multiple output channels, some of which are called "ghost channels". These "ghost channels" are obtained by linear transformation of the input channels, and their computational cost is low;

[0085] The Ghost module adds more feature expression capabilities without introducing too much computation and storage overhead, which can improve the accuracy and feature extraction capabilities of the model;

[0086] S2-3. Ghost-Residual structure of breast pathology image classification model:

[0087] Specifically, in the residual structure, the 1×1 dimension increase operation will generate a large number of similar feature maps. There is a large redundancy between these feature maps, and the degree of redundancy is also related to the number of categories of the classification task. The more categories there are, the more effective feature maps are required. For the 8-classification task of breast pathology images, the residual structure of ResNet will inevitably generate a large number of redundant feature maps. These redundant feature maps increase the number of model parameters and the amount of calculation, which wastes computing resources. Therefore, the present invention uses the Ghost module to propose a Ghost-Residual structure;

[0088] The Ghost-Residual structure replaces the 256 1×1 convolutions in the original residual block with the Ghost module. The Ghost module not only reduces the amount of calculation and parameters of the dimensionality increase operation, but also improves the efficiency and accuracy when facing the 8-classification task of breast pathology images;

[0089] Specifically, the Ghost-Residual structure is as follows Figure 3 and Figure 4As shown in the figure, the convolution layer in the ResNet-50 convolutional neural network convolves the input image to generate a set of feature maps. After visualizing the feature maps generated by the first residual module, we can see some similar feature map pairs. The Ghost module performs linear operations on one of the feature maps generated by ordinary convolution to obtain its similar feature maps. Assuming that the convolution generates a feature map with n channels, the ordinary convolution generates g′ with l channels. x intrinsic feature map, then the “ghost channel” is obtained by linear operation, according to g′ x Generate s ghost feature maps, the formula is:

[0090]

[0091] in, It is a linear operation. The feature map of the xth channel is linearly operated to obtain the yth ghost feature map g xy ; l is the number of channels of the initial feature map; s is the expansion multiple, that is, each channel of the initial feature map can generate multiple new feature maps through linear transformation; the reason why y is at most s-1 is that the initial l-channel feature map needs to be retained, so the number of channels of the final feature map can be n=l·s, that is, each channel is expanded to s times the original, where the convolution kernel size of the linear operation is 1×1, and the expansion multiple s is 2;

[0092] Furthermore, taking the feature map generated by the first residual block of the ResNet model as an example, the amount of computation required for the 1×1 dimensionality increase operation is quantified:

[0093] The size of the input feature map of the 1×1 convolution is 64×56×56, the number of channels of the output feature map is 256, the convolution kernel size of the linear transformation in the Ghost-Residual structure is d=1, and the expansion multiple is s=2;

[0094] The computational effort of the original residual structure is FLOPs1 = 64 × 256 × 1 × 1 × 56;

[0095] The computational cost of Ghost-Residual structure

[0096] Then, the network speed-up ratio r s for:

[0097]

[0098] That is, the FLOPs of the original residual structure is twice that of Ghost-Residual, which means that using the Ghost-Residual structure can not only reduce the redundancy of features, but also achieve the purpose of accelerating calculations.

[0099] S3: Send the image preprocessed in step S1 to the ResNet_GR network for training, and then save its weights as a pre-training model. During the training process, the cross entropy loss function L-softmax loss is used to increase the angular margins between image categories to obtain the enhanced data set D;

[0100] Furthermore, the cross entropy loss function L-softmax in step S3 is:

[0101] In the softmax function, the output of the CNN feature extraction module is its input. Assume that x t is the eigenvector of the tth group of input, W c is the weight of the cth class, b c represents the bias. Then the input f c The definition is as follows:

[0102]

[0103] Further, through the cosine formula transformation, we can get the following f c :

[0104] f c =||W c ||||x t ||cos(θ c )+b c #(4)

[0105] where θ c ∈[0,π] is x t and W c The angle between ||W c ||, making it equal to 1, and at the same time let the bias b c Set to 0, that is:

[0106] f c =||x t ||cos(θ c )#(5)

[0107] Thus, in L-softmax loss, the category prediction depends largely on the cosine similarity, that is, the decision boundary of the category is largely determined by the angle, that is, the decision boundary between category 1 and category 2 is ||x t ||[(cos(θ1)-cos(θ2)]=0, assuming x t Belongs to category 1, so in order to ensure the correct classification, we have ||x t ||cos(θ1)>||x t ||cos(θ2), that is, when cos(θ1)≥cos(θ2), input xt is classified as class 1; when cos(θ1)<cos(θ2), input x t It is classified into 2 categories;

[0108] Furthermore, in order to make the distance between classes more compact, large margin softmax proposes to use a margin positive integer m to constrain the angle, making the angle smaller, that is, the class is more compact and the classes are more separated. At the same time, in order to implement it in the neural network, the cos function is optimized, and the improved formula is as follows:

[0109] f c =||x t ||ψ(θ c )#(6)

[0110] Therefore, the cross entropy loss function L-softmax loss is:

[0111]

[0112] The tth group of input features x t , the corresponding label is z t ,

[0113]

[0114] kπ is an integer multiple of π, k is a constant, and is a positive integer; m ≥ 1 and is an integer, m controls the gap between categories. The larger m is, the more obvious the dispersion between samples of different categories is, and the larger the angular margin is. At the same time, samples belonging to the same category are increasingly aggregated as m increases. m is 4, which has a better effect;

[0115] In order to make the features learned by each category more discriminative, feature normalization is also performed, that is, the feature modulus || x t || is limited to 1, so that the learned features are more focused on optimizing the cosine angle.

[0116] S4: using the pre-trained model and data set D of step S3 and the AMMixup algorithm to establish and train a breast cancer histopathology image classification model, generate new training samples, and introduce an improved monotone decreasing function formula to make the angular margins between mixed image categories more separated;

[0117] Further, step S4 includes:

[0118] S4-1, Mixup algorithm:

[0119] In the neural network, Mixup synthesizes training samples through simple linear combinations, and the expression is as follows:

[0120]

[0121]

[0122] Where (x i ,y i ) and (x j ,y j ) are two samples uniformly sampled from the training set and λ∈[0,1], are synthetic training samples, is the label of the synthetic training sample;

[0123] S4-2, AMMixup method:

[0124] Furthermore, the proposed angular-margin Mixup (AMMixup) method formula is:

[0125]

[0126]

[0127] where λ x The same as that obtained in the original Mixup, and the λ of the mixed sample y According to the following calculation formula, where λ y ∈[0,1]:

[0128]

[0129] in, and Represents the input feature vector x t The angle with the weight of the corresponding category, m ≥ 1 and is a positive integer, ψ(θ c ) is a monotonically decreasing function. The specific formula is shown in step S3. Therefore, the proposed AMMixup is Get mixed input, through Get the mixed label and get λ by the proposed formula y ;

[0130] The general idea shows when AMMixup accurately classifies synthetic labels into corresponding categories and when When y Set to 1, so that the label of the synthetic image is 100% contributed by the c1 class, otherwise When y Set to 0, so that the label of the synthetic image is 100% contributed by the c2th class. At this time, the intra-class difference between the datasets composed of synthetic images becomes smaller and the inter-class difference becomes larger, allowing the model to further learn the feature angle and learn discriminative features, making it easier to classify images under imbalanced categories.

[0131] S5: using the enhanced data set D in step S3 and the data set consisting of the new training samples in step S4 as input, training and verifying the pathological image classification model to obtain a trained classification model;

[0132] Furthermore, in step S5, the classification model is trained using the PReLU activation function, with a weight decay of 0.0005, a momentum of 0.9, a batch size of 16, and learning rates of 0.1, 0.01, and 0.001.

[0133] S6: Use the trained classification model to test the test set and output the classification result through the activation function;

[0134] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for multi-classification of breast pathology images under class imbalance, characterized in that: The method comprises the following steps: S1: Obtain a breast pathology image dataset with known category information and labels, and preprocess it to achieve model training, verification, and testing; S2: Based on ResNet, the residual structure Ghost-Residual is used to build the ResNet_GR network to reduce feature redundancy. S3: Send the image preprocessed in step S1 to the ResNet_GR network for training, and then save its weights as a pre-training model. During the training process, the cross entropy loss function L-softmax loss is used to increase the angular margins between image categories to obtain the enhanced data set D; S4: Use the pre-trained model and data set D in step S3 and the AMMixup algorithm to establish and train a pathological image classification model, generate new training samples, and introduce an improved monotone decreasing function formula to make the angular margins between mixed image categories more separated; S5: using the enhanced data set D in step S3 and the data set consisting of the new training samples in step S4 as input, training and verifying the pathological image classification model to obtain a trained classification model; S6: Use the trained classification model to test the test set and output the classification results through the activation function.

2. The method for multi-classification of breast pathology images under class imbalance according to claim 1, characterized in that: Step S1 includes: S1-1. Breast pathology image preprocessing: Specifically, the image is randomly flipped horizontally, rotated left and right, randomly cropped and scaled, pixel values ​​are normalized, and the data is converted into Tensor form; S1-2. Constructing a breast pathology image dataset: Specifically, the images after the above preprocessing are divided into a training set, a validation set, and a test set in a ratio of 8:1:

1.

3. The method for multi-classification of breast pathology images under class imbalance according to claim 1, characterized in that: Step S2 includes: S2-1, ResNet convolutional neural network feature extraction residual module: Specifically, the input image will first be convolved and pooled in the backbone network to achieve feature extraction. The residual structure is used in each module of the original deep residual network ResNet. The residual structure consists of residual and identity mapping. The residual is first reduced in dimension by 1×1 convolution, then feature extracted by 3×3 convolution, and finally increased in dimension by 1×1 convolution. Normalization operation and Relu function are also used in the convolution process to increase nonlinearity. The identity mapping uses 256 1×1 convolutions to be consistent with the output dimension of the residual to achieve addition. S2-2, Ghost module: The core idea of ​​Ghost is to introduce the concept of a "ghost channel". In the traditional convolution operation, each channel of the input feature map will generate a channel of the output feature map, while in the Ghost module, each input channel will generate multiple output channels, some of which are called "ghost channels". These "ghost channels" are obtained by linear transformation of the input channels. S2-3. Ghost-Residual structure of breast pathology image classification model: Specifically, the present invention proposes a Ghost-Residual structure using the Ghost module; The Ghost-Residual structure replaces the 256 1×1 convolutions in the original residual block with the Ghost module.

4. The method for multi-classification of breast pathology images under class imbalance according to claim 3, characterized in that: Specifically, the Ghost-Residual structure is as follows: the convolution layer in the ResNet-50 convolutional neural network convolves the input image to generate a set of feature maps. After visualizing the feature maps generated by the first residual module, some similar feature map pairs can be seen. The Ghost module performs linear operations on one of the feature maps generated by ordinary convolution to obtain its similar feature maps. Assuming that the convolution generates a feature map with n channels, the ordinary convolution generates g′ with l channels. x intrinsic feature map, then the "ghost channel" is obtained by linear operation, according to g′ x Generate s ghost feature maps, the formula is: in, It is a linear operation. The feature map of the xth channel is linearly operated to obtain the yth ghost feature map g xy ; l is the number of channels of the initial feature map; s is the expansion multiple, that is, each channel of the initial feature map can generate multiple new feature maps through linear transformation; the reason why y is at most s-1 is that the initial l-channel feature map needs to be retained, so the number of feature map channels finally obtained can be n=l·s, that is, each channel is expanded to s times the original.

5. The method for multi-classification of breast pathology images under class imbalance according to claim 1, characterized in that: The cross entropy loss function L-softmax loss in step S3 is: In the softmax function, the output of the CNN feature extraction module is its input. Assume that x t is the eigenvector of the tth group of input, W c is the weight of the cth class, b c represents the bias, then the input f c The definition is as follows: Further, through the cosine formula transformation, we can get the following f c : f c =||W c ||||x t ||cos(θ c )+b c #(4) where θ c ∈[0,π] is x t and W c The angle between c , making it equal to 1, and at the same time let the bias b c Set to 0, that is: f c =||x t ||cos(θ c )#(5) That is to say, the decision boundary of the category is largely determined by the angle, that is, assuming that the decision boundary between category 1 and category 2 is ||x t ||[(cos(θ1)-cos(θ2)]=0, assuming x t Belongs to category 1, so in order to ensure the correct classification, we have ||x t ||cos(θ1)>||x t ||cos(θ2), that is, when cos(θ1)≥cos(θ2), input x t is classified as class 1; when cos(θ1)<cos(θ2), input x t Classified into 2 categories.

6. The method for multi-classification of breast pathology images under class imbalance according to claim 5, characterized in that: In order to make the distance between classes more compact, large margin softmax proposes to use a margin positive integer m to constrain the angle, making the angle smaller, that is, the class is more compact and the classes are more separated. At the same time, in order to implement it in the neural network, the cos function is optimized, and the improved formula is as follows: f c =||x t ||ψ(θ c )#(6) Therefore, the cross entropy loss function L-softmax loss is: The tth group of input features x t , the corresponding label is z t , kπ is an integer multiple of π, k is a constant, a positive integer; m ≥ 1 and is an integer, m controls the gap between categories. The larger m is, the more obvious the dispersion between samples of different categories is, and the larger the angular margin is. At the same time, samples belonging to the same category are increasingly clustered together as m increases.

7. The method for multi-classification of breast pathology images under class imbalance according to claim 6, characterized in that: Step S4 includes: S4-1, Mixup algorithm: In neural networks, one of the most famous data augmentation techniques for image classification problems is Mixup, which synthesizes training samples through simple linear combinations, as shown below: Where (x i ,y i ) and (x j ,y j ) are two samples uniformly sampled from the training set and λ∈[0,1], are synthetic training samples, is the label of the synthetic training sample; S4-2, AMMixup method: Furthermore, the proposed angular-margin Mixup (AMMixup) method formula is: where λ x The same as that obtained in the original Mixup, and the λ of the mixed sample y According to the following formula, λ y ∈[0,1]: in, and Represents the input feature vector x t The angle with the weight of the corresponding category, m ≥ 1 and is a positive integer, ψ(θ c ) is a monotonically decreasing function. The specific formula is shown in step S3. Therefore, the proposed AMMixup is Get mixed input through Get the mixed label and get λ by the proposed formula y .

8. The method for multi-classification of breast pathology images under class imbalance according to claim 1, characterized in that: In step S5, the classification model is trained using the PReLU activation function and weight decay regularization.

Citation Information

Cited By

  • Road crack disease classification method and device based on semantic perception Mixup

    CN119693946A

  • Dry-type transformer vibration signal fault diagnosis method and system based on improved channel attention mechanism

    CN120873848A

  • Cancer tissue pathological image classification method based on comparative learning and optimal transmission

    CN121095674A