Modal classification model training method, modal classification model application method, modal classification model, modal classification equipment and modal classification medium
Through knowledge distillation technology, a large number of unlabeled ultrasound images are marked and the student model is trained through the teacher's modal classification model, which solves the poor model performance problem caused by inaccurate marking in the existing technology, and improves the accuracy of modal classification and efficiency.
Patent Information
- Application Number
- CN202411217864.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2024-11-15
Smart Images

Figure CN118968224A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of machine learning, and in particular to the training and application methods, models, devices, and media of modal classification models. Background Art
[0002] Breast nodules are a common form of breast lesions and are usually detected and evaluated through ultrasound images. Ultrasound images have become an important tool for breast nodule screening due to their non-invasiveness, real-time nature, and good soft tissue resolution. The diagnosis of breast nodules requires detailed analysis of ultrasound images to distinguish different types of nodules. In the detection and evaluation of breast nodules, doctors usually consider ultrasound image information of different modalities (for example, CEUS, Doppler, Elastography, B-mode, and other types of interference images, etc.) to improve the accuracy and efficiency of diagnosis. However, the features of ultrasound images of different modalities are very different. If they are not distinguished and uniformly collected and trained, the accuracy will be reduced. Therefore, accurate and efficient classification of ultrasound images of different modalities helps to improve the accuracy and work efficiency of doctors in diagnosing the type of breast nodules.
[0003] With the development of machine learning, some researchers have trained neural networks to classify ultrasound images of different modalities in order to better assist doctors in diagnosing breast nodules. However, the training data set directly relies on manual labeling by experienced doctors, which is not only time-consuming and labor-intensive, but also easily affected by human factors. That is, a large amount of manual work causes doctors to be too tired, making it impossible to guarantee the modal accuracy and consistency of the labeled ultrasound images, resulting in poor performance of the model trained using inaccurately labeled ultrasound images of different modalities. Summary of the invention
[0004] The present application provides a training and application method of a modality classification model and a modality classification model to solve the problem that the existing training model using inaccurately labeled different modality ultrasound images results in poor model performance.
[0005] The present application provides a method for training a modality classification model, wherein the modality classification model is used to perform modality classification on ultrasound images, and the method comprises:
[0006] Acquire a first ultrasound image dataset and a second ultrasound image dataset, wherein the first ultrasound image dataset includes a plurality of ultrasound images of labeled modality categories, and the second ultrasound image dataset includes a plurality of ultrasound images of unlabeled modality categories;
[0007] Initialize the teacher modality classification model and the student modality classification model;
[0008] Using the first ultrasound image data set to perform multiple iterations of training on the teacher modality classification model until convergence;
[0009] Using the converged teacher modality classification model to label each ultrasound image in the second ultrasound image dataset, and using the labeling result as the label corresponding to each ultrasound image, and each ultrasound image in the second ultrasound image dataset and its corresponding label constitute a second ultrasound image labeling dataset;
[0010] The first ultrasound image dataset and the second ultrasound image annotation dataset constitute a target ultrasound image dataset, and the student modal classification model is iteratively trained multiple times using the target ultrasound image dataset until convergence, and the converged student modal classification model is used as the modal classification model.
[0011] In some embodiments of the present application, the ultrasound images in the first ultrasound image data set and the second ultrasound image data set are obtained by dividing multiple existing ultrasound images according to the patient ID division method.
[0012] In some embodiments of the present application, the ultrasound images in the first ultrasound image dataset are annotated in the following manner:
[0013] acquiring a plurality of ultrasound images;
[0014] Annotating the modality categories of some of the ultrasound images by manual annotation, and constructing a data set based on the annotated results;
[0015] The deep learning model is iteratively trained multiple times using the data set until convergence, and the converged deep learning model is used to label the modal categories of the remaining ultrasound images. The modal category of each ultrasound image labeled by the deep learning model is then manually labeled to complete the labeling of the remaining ultrasound images.
[0016] In some embodiments of the present application, the student modality classification model includes:
[0017] A data segmentation module, used to perform segmentation processing on each ultrasound image in the target ultrasound image data set, and perform linear transformation on the segmentation result to obtain a feature vector corresponding to each ultrasound image;
[0018] Multiple self-attention mechanism modules are used to perform self-attention calculation on the feature vector corresponding to each ultrasound image to obtain the attention feature corresponding to each ultrasound image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to a window size of 16x16;
[0019] A feature transformation module, used for performing a pooling operation on the attention feature corresponding to each ultrasound image output by the last self-attention mechanism module to obtain an intermediate feature corresponding to each ultrasound image;
[0020] The modality classification module is used to obtain the modality category corresponding to each ultrasound image based on the intermediate features corresponding to each ultrasound image.
[0021] In some embodiments of the present application, the modality category of each ultrasound image in the first ultrasound image dataset and the second ultrasound image dataset is encoded using a one-hot encoding method to complete the labeling.
[0022] In some embodiments of the present application, the student modality classification model parameters are updated according to the cross entropy loss during each iterative training process, and the cross entropy loss is:
[0023]
[0024] Among them, C is the number of modal categories, y i represents the i-th binary number in the label corresponding to the i-th ultrasound image in the second ultrasound image dataset, represents the modality category prediction value corresponding to the i-th ultrasound image in the second ultrasound image dataset.
[0025] A second aspect of the present application provides a modality classification model, which is used to perform modality classification on ultrasound images, and the model includes:
[0026] The data segmentation module is used to segment the ultrasound image and perform linear transformation on the segmentation result to obtain the feature vector corresponding to the ultrasound image;
[0027] Multiple self-attention mechanism modules are used to perform self-attention calculation on the feature vector corresponding to the ultrasound image to obtain the attention feature corresponding to the ultrasound image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to a window size of 16x16;
[0028] A feature transformation module, used for performing a pooling operation on the attention feature corresponding to the ultrasound image output by the last self-attention mechanism module to obtain an intermediate feature corresponding to the ultrasound image;
[0029] The modality classification module is used to obtain the modality category corresponding to the ultrasound image based on the intermediate features corresponding to the ultrasound image.
[0030] A third aspect of the present application provides an application method of a modality classification model, the method comprising:
[0031] Obtain ultrasound images of breast nodules;
[0032] The modality classification model described in the above embodiment is trained based on the breast nodule ultrasound image to obtain the modality category corresponding to the breast nodule ultrasound image.
[0033] The fourth aspect of the present application provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first and third aspects of the above-mentioned embodiments when executing the computer program.
[0034] The fifth aspect of the present application provides a computer-readable storage medium having program instructions stored thereon, and when the program instructions are executed by a processor, the method described in any one of the first aspect and the third aspect of the above embodiments is implemented.
[0035] The present application has the following beneficial effects: the training scheme of the modal classification model of the present application trains the teacher modal classification model by using a small number of annotated ultrasound images of different modalities, and annotates a large number of ultrasound images of different modalities using the trained teacher modal classification model, and then the annotated ultrasound images of the training teacher modal classification model and the ultrasound images annotated by the teacher modal classification model constitute a data set to train the student modal classification model. Compared with the existing method of annotating a large number of ultrasound images of different modalities by manual annotation, the present application improves the modal accuracy of ultrasound images by annotating a large number of ultrasound images of different modalities using the teacher modal classification model, and trains the student modal classification model using ultrasound images of different modalities annotated by the teacher modal classification model. This training method transfers the patterns and knowledge learned by the teacher modal classification model to the student modal classification model in the form of pseudo-labels, so that the student modal classification model does not need to learn all the patterns from scratch, but directly learns more accurately based on the guidance given by the teacher modal classification model for learning ultrasound images of different modalities, which allows the student model to be trained faster while improving the performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0037] Figure 1 It is a schematic diagram of ultrasound image framework of different modalities;
[0038] Figure 2 It is a flow chart of an embodiment of a modality classification model training method provided by the present application;
[0039] Figure 3 It is a schematic flow chart of an embodiment of an ultrasound image annotation method in a first ultrasound image data set provided by the present application;
[0040] Figure 4 It is a schematic diagram of a flow chart of an embodiment of a method for constructing a first ultrasound image dataset and a second ultrasound image dataset provided by the present application;
[0041] Figure 5 It is a framework schematic diagram of an embodiment of a learning modality classification model structure provided by the present application;
[0042] Figure 6 It is a schematic diagram of a framework of an embodiment of an electronic device provided by the present application;
[0043] Figure 7 It is a schematic diagram of a framework of an embodiment of a computer-readable storage medium provided by the present application. DETAILED DESCRIPTION
[0044] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.
[0045] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.
[0046] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.
[0047] As described in the background technology, the existing neural network models for classifying ultrasound images of different modalities rely directly on manual labeling by experienced doctors for training data sets, which is not only time-consuming and labor-intensive, but also easily affected by human factors. That is, a large amount of manual work causes doctors to be too tired, making it impossible to guarantee the accuracy and consistency of classification, resulting in poor performance of the model trained using inaccurately labeled ultrasound images.
[0048] In order to solve the above problems, the present application proposes a new solution, which trains the modal classification model through knowledge distillation. In summary, the training method of the present application uses a small number of labeled ultrasound images of different modalities to train the teacher modal classification model, and uses the trained teacher modal classification model to annotate a large number of ultrasound images of different modalities, and then the labeled ultrasound images for training the teacher modal classification model and the ultrasound images annotated by the teacher modal classification model constitute a data set to train the student modal classification model. Compared with the existing method of manually labeling a large number of ultrasound images of different modalities, the present application uses a teacher modality classification model to label a large number of ultrasound images of different modalities to improve the modality accuracy of ultrasound images, and uses the ultrasound images of different modalities labeled by the teacher modality classification model to train the student modality classification model. This training method transfers the patterns and knowledge learned by the teacher modality classification model to the student modality classification model in the form of pseudo-labels, so that the student modality classification model does not need to learn all the patterns from scratch, but directly learns more accurately based on the guidance given by the teacher modality classification model for learning ultrasound images of different modalities. This allows the student model to be trained faster while improving the performance of the model.
[0049] Before specifically introducing the embodiments of the present application, Figure 1 First, we will introduce ultrasound images of different modalities.
[0050] like Figure 1 As shown, it shows schematic diagrams of ultrasound images of different modes, where: Figure 1 (a) is an interference ultrasound image (i.e., an ultrasound image of the corresponding interference modality). This modality ultrasound image generally refers to an ultrasound image with poor image quality or containing additional non-target information due to various reasons (such as equipment noise, operator technique, patient body movement, etc.); Figure 1 (b) is a B-mode ultrasound image (corresponding to a conventional ultrasound image). This mode of ultrasound image is one of the most common ultrasound imaging methods and is used to display a two-dimensional cross-sectional image of the tissue structure. In breast examination, B-mode ultrasound can help doctors observe the location, size, shape, edge characteristics, and internal echo characteristics of nodules; Figure 1(c) is an ultrasound image of angiography (i.e., an ultrasound image of the corresponding angiography modality). This type of ultrasound image (sometimes also called contrast-enhanced ultrasound, CEUS) uses special contrast agents to enhance the visibility of blood vessels, thereby helping doctors assess the blood supply of the tumor. This is very important for determining whether a nodule is benign or malignant, because malignant tumors often have a richer blood supply; Figure 1 (d) Doppler ultrasound image (corresponding to the blood flow modality ultrasound image). This modality of ultrasound image can provide information on blood flow dynamics, including the direction and speed of blood flow. In breast examination, observing the blood flow around the nodule can help determine the nature of the nodule. Malignant tumors are often accompanied by abnormal blood flow patterns. Figure 1 (e) is a vascular elastic ultrasound image (i.e., the corresponding elastic modal ultrasound image). This modality of ultrasound image is a technology for evaluating tissue hardness. It uses ultrasound to measure the degree of deformation of tissue under external force, and then infers the hardness of the tissue. Generally speaking, malignant tumors are harder than benign lesions, so this technology is very useful for distinguishing benign from malignant nodules.
[0051] Each of the above-mentioned ultrasound imaging modalities has its own unique advantages. The combined use of these different imaging methods can improve the accuracy and comprehensiveness of diagnosis. In actual clinical applications, doctors may choose an appropriate modality combination for comprehensive analysis based on specific circumstances.
[0052] The present application is described in detail below with reference to the accompanying drawings and specific embodiments.
[0053] According to one embodiment of the present application, Figure 2As shown, the present application provides a training method for a modality classification model, wherein the modality classification model is used to perform modality classification on ultrasound images, and the method includes: S1, obtaining a first ultrasound image data set and a second ultrasound image data set, wherein the first ultrasound image data set includes a plurality of ultrasound images of labeled modality categories, and the second ultrasound image data set includes a plurality of ultrasound images of unlabeled modality categories; S2, initializing a teacher modality classification model and a student modality classification model; S3, using the first ultrasound image data set to perform multiple iterative training on the teacher modality classification model until convergence; S4, using the converged teacher modality classification model to annotate each ultrasound image in the second ultrasound image data set, and using the annotated result as the label corresponding to each ultrasound image, and forming a second ultrasound image annotated data set with each ultrasound image in the second ultrasound image data set and its corresponding label; S5, forming a target ultrasound image data set with the first ultrasound image data set and the second ultrasound image annotated data set, and using the target ultrasound image data set to perform multiple iterative training on the student modality classification model until convergence, and using the converged student modality classification model as the modality classification model. The steps S1, S2, S4 and S5 are described in detail below.
[0054] 1. Step S1
[0055] In step S1, a first ultrasound image dataset and a second ultrasound image dataset are acquired, wherein the first ultrasound image dataset includes a plurality of ultrasound images of labeled modality categories, and the second ultrasound image dataset includes a plurality of ultrasound images of unlabeled modality categories.
[0056] Since the same patient may undergo multiple ultrasound examinations, and one ultrasound examination will produce multiple ultrasound images, the usual strategy is to divide by the number of images, which will lead to an artificially high model accuracy. To this end, according to one embodiment of the present application, the ultrasound images in the first ultrasound image data set and the second ultrasound image data set are obtained by dividing the existing multiple ultrasound images according to the patient ID division method. It should be noted that the ultrasound images in the first ultrasound image data set and the second ultrasound image data set can also be divided by the number of images, or divided by ultrasound examination as a unit, or divided by patient as a unit. The specific division method depends on the characteristics of the ultrasound image or the task requirements, and is not specifically limited here.
[0057] It can be seen from the above embodiments that when the existing multiple ultrasound images are divided according to the patient ID division method and the obtained first ultrasound image data set and second ultrasound image data set are used for model training, the overfitting phenomenon can be better avoided.
[0058] According to one embodiment of the present application, Figure 3As shown, the ultrasonic images in the first ultrasonic image data set are annotated by executing the following steps: S11, acquiring multiple ultrasonic images; S12, annotating the modal categories of some of the ultrasonic images by manual annotation, and constructing a data set based on the annotated results; S13, using the data set to iterate the deep learning model for multiple training until convergence, and using the converged deep learning model to annotate the modal categories of the remaining ultrasonic images, and then manually annotating the modal categories of each ultrasonic image annotated by the deep learning model to complete the annotation of the remaining ultrasonic images. According to another embodiment of the present application, the modal category of each ultrasonic image in the first ultrasonic image data set is encoded by a unique hot encoding method to complete the annotation.
[0059] It can be seen from the above embodiments that by combining the manual labeling method and the deep learning model labeling method to label the ultrasound image, the accuracy of the ultrasound image modality labeling is improved.
[0060] According to one embodiment of the present application, Figure 4 As shown, the first ultrasound image data set and the second ultrasound image data set are obtained by performing the following steps: S14, acquiring multiple ultrasound images with original resolution; S15, scaling each of the ultrasound images with original resolution according to the first preset resolution to obtain each ultrasound image with the first preset resolution; S16, scaling each ultrasound image with the first preset resolution using the bicubic interpolation method according to the pyramid model method to obtain each ultrasound image with the second preset resolution, wherein the pyramid model method is to scale each ultrasound image with the first preset resolution in descending order from high to low; S17, all ultrasound images with the first preset resolution constitute the first ultrasound image data set, and all ultrasound images with the first preset resolution or any one of the second preset resolutions constitute the second ultrasound image data set. According to another embodiment of the present application, the original resolution is: 1260x910; the first preset resolution is: 1024x1024; and the multiple second preset resolutions are: 512x512, 384x384 and 224x224 respectively. It should be noted that the original resolution of the ultrasound image in the above embodiment is only an embodiment of the present application. The original resolution of the ultrasound image is determined based on the ultrasound image acquired in the actual scene and is not specifically limited here. The first preset resolution and the second preset resolution are set according to the task requirements and are not specifically limited here.
[0061] It can be seen from the above embodiments that the present application uses high-resolution ultrasound images as training sets to train the modal classification model, which means that the model can directly accept images with higher resolution, thereby being able to capture the detailed information in the image more finely, thereby improving the classification accuracy of ultrasound images of different modalities.
[0062] Step S2
[0063] In step S2, the teacher modality classification model and the student modality classification model are initialized.
[0064] Since the image resolution used in general image classification tasks is 224x224 or 384x384, the original resolution of general ultrasound images is 1260x910, and they are uniformly processed to a resolution of 1024x1024. If a conventional image classification model is used directly, it will inevitably lead to incomplete utilization of ultrasound image information and loss of important information in ultrasound images. Therefore, this application uses the swin-transformer model as the teacher modal classification model, and redesigns a student modal classification model based on the swin-transformer model. The student modal classification model structure of this application is described in detail below.
[0065] According to one embodiment of the present application, Figure 5 As shown, the student modality classification model includes: a data segmentation module (i.e. Figure 5 Patch Embedding module in the target ultrasound image dataset), which is used to segment each ultrasound image in the target ultrasound image dataset and perform linear transformation on the segmentation result to obtain the feature vector corresponding to each ultrasound image; multiple self-attention mechanism modules (i.e. Figure 5 Swin Block Sequence 1-Swin Block Sequence 4) is used to perform self-attention calculation on the feature vector corresponding to each ultrasound image to obtain the attention feature corresponding to each ultrasound image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to the window size of 16x16; feature transformation module (i.e. Figure 5 The Global Average Pooling module in the above module is used to perform a pooling operation on the attention features corresponding to each ultrasound image output by the last self-attention mechanism module to obtain the intermediate features corresponding to each ultrasound image; the modality classification module (i.e. Figure 5 The Linear Classification Head module in the image is used to obtain the modality category corresponding to each ultrasound image based on the intermediate features corresponding to each ultrasound image.
[0066] It can be seen from the above embodiments that, compared with the existing window size of 7×7, the present application increases the window size to 16×16. This adjustment is particularly important for high-resolution images because it can retain more spatial details and avoid information loss due to image reduction. Therefore, this adjustment allows each window to cover contextual information of a larger area in the image, which helps the model to better understand and integrate local and global features when processing high-resolution images, thereby making full use of ultrasound image information and improving the accuracy of model classification.
[0067] Step S4
[0068] In step S4, each ultrasound image in the second ultrasound image dataset is labeled using the converged teacher modality classification model, and the labeled result is used as the label corresponding to each ultrasound image, and each ultrasound image in the second ultrasound image dataset and its corresponding label constitute a second ultrasound image labeled dataset. According to one embodiment of the present application, the modality category of each ultrasound image in the second ultrasound image dataset is encoded using a one-hot encoding method to complete the labeling.
[0069] In the above embodiment, the use of one-hot encoding to encode ultrasound images of different modalities can avoid the size relationship between categories, making it easier for the modal classification model to learn the relationship between categories, and also facilitate the training and prediction of the modal classification model for multiple classifications; it can improve the generalization ability of the modal classification model (because it can better represent the distance and similarity between categories, thereby improving the generalization ability of the model for unknown data); further, the vector form of one-hot encoding is easy to calculate and process, and can be well matched with the calculation process of the modal classification model, thereby improving the calculation efficiency. It should be noted that the use of one-hot encoding to label the modal categories of ultrasound images is only one of the embodiments of the present application. With the continuous development of neural network training methods, its labeling method can adopt other methods that can further improve the performance of the modal classification model, which is not specifically limited here.
[0070] Step S5
[0071] In step S5, the first ultrasound image dataset and the second ultrasound image annotation dataset constitute a target ultrasound image dataset, and the student modality classification model is iteratively trained multiple times using the target ultrasound image dataset until convergence, and the converged student modality classification model is used as the modality classification model. According to one embodiment of the present application, the student modality classification model parameters are updated according to the cross entropy loss during each iterative training process, and the cross entropy loss is:
[0072]
[0073] Among them, C is the number of modal categories, y i represents the i-th binary number in the label corresponding to the i-th ultrasound image in the second ultrasound image dataset, represents the modality category prediction value corresponding to the i-th ultrasound image in the second ultrasound image dataset.
[0074] In order to more clearly understand the data form of the label of the training sample of this application and the calculation process of the loss function, schematically, for example, there are 5 different modality categories corresponding to ultrasound images, and the codes are 00001, 00010, 00100, 01000, 10000 respectively. Compared with the output results, the cross entropy loss is used. Calculate the single sample loss (a single sample indicates an ultrasound image). For example, the output result is (0.1, 0.05, 0.8, 0.02, 0.03), and the label is (0, 0, 1, 0, 0). The cross entropy loss calculation method for a single sample is: It should be noted that the cross entropy loss function used above is only one embodiment of the present application. With the continuous development of neural network training methods, its loss function can adopt other loss functions that can further improve the performance of the modal classification model, which is not specifically limited here.
[0075] It can be seen from the above description that by training the student modal classification model through the training method of the above embodiment, a modal classification model with better performance can be obtained.
[0076] In order to verify the effectiveness of the modal classification model structure and modal classification training method designed in the above embodiment of the present application, the inventor conducted a series of experiments. The following is an explanation of the experimental parameter settings and model training experimental results.
[0077] 1. Experimental related parameter settings
[0078] Before starting the experiment, it is necessary to set the structural parameters of each module in the modal classification model and the hyperparameter information of the modal classification model during training. Schematically, as shown in Table 1, it shows the structural parameter information of each module in the modal classification model of middle school students in this application. These parameter information are some basic setting parameters of the deep learning model, which will not be described in detail here. It should be noted that the parameter information of each module in Table 1 is only an example structure in the experimental process. All structural parameters can be adjusted according to the requirements of the task or the final experimental results, and are not specifically limited here.
[0079] Table 1
[0080]
[0081] As shown in Table 2, it shows some hyperparameter setting information of the student modality classification model during training. These hyperparameter information are some basic setting parameters of the deep learning model, which will not be described in detail here. It should be noted that the hyperparameter information of the student modality classification model during training in Table 2 is only an example in the experimental process. All hyperparameters can be adjusted according to the requirements of the task or the final experimental results, and are not specifically limited here.
[0082] Table 2
[0083]
[0084] 2. Model Training Experiment Results
[0085] This application manually annotated 2238 ultrasound images collected in December 2023, and used ResNet to train the dataset to obtain a preliminary model with an accuracy of 94.7%; then, the model was used to assist in the annotation of the remaining unlabeled images in 2023, and the annotations were further revised through manual review, and finally a complete dataset containing 27,690 images was constructed.
[0086] After the dataset is constructed, we divide it into training set, validation set and test set in a ratio of 6:2:2. In order to meet the needs of model training, this application uniformly adjusts the original resolution of 1260x910 images to 1024x1024. At the same time, using the pyramid model technology, four datasets with different resolutions are generated through bicubic interpolation: 1024x1024, 512x512, 384x384, and 224x224.
[0087] In the model training stage, we used a dataset with a resolution of 1024x1024 and combined it with the Swin-Transformer model to train the teacher modality classification model; then, for datasets with different resolutions (384x384 and 224x224), we trained the student modality classification model based on the Swin-Base architecture; in addition, we also trained a student modality classification model with a resolution of 1024x1024 based on the modified Swin-Base architecture. In order to enhance the learning effect of the student modality classification model, this application uses the teacher modality classification model to generate soft labels for unlabeled ultrasound images, and combines them with the original training set and validation set to train the student modality classification model.
[0088] The experimental results show that the accuracy of the teacher modality classification model on the test set reached 98.7%, while the accuracy of the modified Swin-Base student modality classification model with a resolution of 1024x1024 (i.e., the student modality classification model designed by this application) was 98.4%; the Swin-Base model with a resolution of 384x384 (i.e., the Swin-Transformer model) reached 98.2%; and the Swin-Base model with a resolution of 224x224 reached 98.1%. Based on the comprehensive consideration of the computational complexity and accuracy of the model, this application finally selected the modified Swin-Base student modality classification model as the final deployment model.
[0089] In summary, compared with the existing method of manually labeling a large number of ultrasound images of different modalities, the present application uses a teacher modality classification model to label a large number of ultrasound images of different modalities to improve the modality accuracy of ultrasound images, and uses ultrasound images of different modalities labeled by the teacher modality classification model to train the student modality classification model. This training method transfers the patterns and knowledge learned by the teacher modality classification model to the student modality classification model in the form of pseudo-labels, so that the student modality classification model does not need to learn all the patterns from scratch, but directly learns more accurately based on the guidance given by the teacher modality classification model for learning ultrasound images of different modalities. This allows the student model to be trained faster while improving the performance of the model.
[0090] In addition, using the modal classification model training method described in any of the above embodiments, according to an embodiment of the present application, a modal classification model is provided, wherein the modal classification model includes: a data segmentation module, used to perform segmentation processing on the ultrasonic image, and linearly transform the result of the segmentation processing to obtain a feature vector corresponding to the ultrasonic image; multiple self-attention mechanism modules, used to perform self-attention calculation on the feature vector corresponding to the ultrasonic image to obtain the attention feature corresponding to the ultrasonic image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to a window size of 16x16; a feature transformation module, used to perform a pooling operation on the attention feature corresponding to the ultrasonic image output by the last self-attention mechanism module to obtain the intermediate feature corresponding to the ultrasonic image; a modal classification module, used to obtain the modal category corresponding to the ultrasonic image based on the intermediate feature corresponding to the ultrasonic image.
[0091] In practical applications, according to the modal classification model of the above-mentioned embodiment, the present application provides an application method of the modal classification model, the method comprising: acquiring an ultrasound image of a breast nodule; using the modal classification model described in the above-mentioned embodiment to obtain the modal category corresponding to the ultrasound image of the breast nodule based on the ultrasound image of the breast nodule.
[0092] It can be seen from the above embodiments that the modality classification model trained by the present application can improve the classification accuracy of ultrasound images.
[0093] Based on the inventive concept of the above embodiments, the present application further provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in the above embodiments when executing the computer program. Figure 6 Provide detailed explanation.
[0094] like Figure 6 As shown, it shows the electronic device of the present application, which may specifically include a processor 110 and a memory 120. The memory 120 is coupled to the processor 110.
[0095] The processor 110 is used to control the operation of the electronic device. The processor 110 may also be referred to as a CPU (Central Processing Unit). The processor 110 may be an integrated circuit chip having the ability to process signals. The processor 110 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general-purpose processor may be a microprocessor or the processor 110 may also be any conventional processor, etc.
[0096] The memory 120 is used to store computer programs, and may be a RAM, a ROM, or other types of storage terminals. Specifically, the memory 120 may include one or more computer-readable storage media, which may be non-transitory or transient. The memory 120 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage terminals, flash memory storage terminals. In some embodiments, the non-transitory computer-readable storage medium in the memory 120 is used to store at least one program code.
[0097] The processor 110 is used to execute the computer program stored in the memory 120 to implement the methods described in the various method embodiments of the present application.
[0098] In some embodiments, the electronic device may further include: a peripheral terminal interface 130 and at least one peripheral terminal. The processor 110, the memory 120 and the peripheral terminal interface 130 may be connected via a bus or a signal line. Each peripheral terminal may be connected to the peripheral terminal interface 130 via a bus, a signal line or a circuit board. Specifically, the peripheral terminal includes: at least one of a radio frequency circuit 140, a display screen 150, an audio circuit 160 and a power supply 170.
[0099] The peripheral terminal interface 130 may be used to connect at least one peripheral terminal related to I / O (Input / output) to the processor 110 and the memory 120. In some embodiments, the processor 110, the memory 120, and the peripheral terminal interface 130 are integrated on the same chip or circuit board; in some other implementations, any one or two of the processor 110, the memory 120, and the peripheral terminal interface 130 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0100] The radio frequency circuit 140 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 140 communicates with the communication network and other IoT devices through electromagnetic signals, and the radio frequency circuit 140 is the communication circuit of the electronic device. The radio frequency circuit 140 converts the electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 140 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, an operator identity module card, and the like. The radio frequency circuit 140 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 140 may also include circuits related to NFC (Near Field Communication), which is not limited in this application.
[0101] The display screen 150 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 150 is a touch display screen, the display screen 150 also has the ability to collect touch signals on the surface or above the surface of the display screen 150. The touch signal can be input to the processor 110 as a control signal for processing. At this time, the display screen 150 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 150 can be one, set on the front panel of the electronic device; in other embodiments, the display screen 150 can be at least two, respectively set on different surfaces of the electronic device or in a folding design; in other embodiments, the display screen 150 can be a flexible display screen, set on a curved surface or a folding surface of the electronic device. Even, the display screen 150 can also be set to a non-rectangular irregular shape, that is, a special-shaped screen. The display screen 150 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light□EmittingDiode, organic light-emitting diode).
[0102] The audio circuit 160 may include a microphone and a speaker. The microphone is used to collect sound waves from the operator and the environment, and convert the sound waves into electrical signals and input them into the processor 110 for processing, or input them into the radio frequency circuit 140 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there can be multiple microphones, which are respectively arranged in different parts of the electronic device. The microphone can also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 110 or the radio frequency circuit 140 into sound waves. The speaker can be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 160 may also include a headphone jack.
[0103] The power supply 170 is used to power various components in the electronic device. The power supply 170 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 170 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged through a wired line, and a wireless rechargeable battery is a battery that is charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0104] For a detailed description of the functions and execution processes of each functional module or component in the electronic device embodiment of the present application, reference can be made to the description in the above-mentioned method embodiments of the present application, which will not be repeated here.
[0105] In the several embodiments provided in the present application, it should be understood that the disclosed electronic devices and methods can be implemented in other ways. For example, the various embodiments of the electronic devices described above are only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0106] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0107] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0108] Based on the inventive concept of the above embodiment, the present application also provides a computer-readable storage medium storing a computer program, which can be executed by a processor to implement the above projection area calculation method. Figure 7 The execution process of the above-mentioned embodiment in a computer-readable storage medium is described.
[0109] like Figure 7As shown, it shows the computer-readable storage medium of the present application. If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium 200. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions / computer programs to enable an IoT device (which can be a personal computer, server, or network terminal, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: various media such as a USB flash drive, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a disk or an optical disk, and electronic terminals such as computers, mobile phones, laptops, tablet computers, cameras, etc. having the above-mentioned storage medium.
[0110] The description of the execution process of the program data in the computer-readable storage medium can refer to the description in the above-mentioned method embodiments of the present application, which will not be repeated here.
[0111] The above descriptions are merely embodiments of the present application and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
[0112] Those skilled in the art will appreciate that, in the above method of specific implementation, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of the steps should be determined by their functions and possible internal logic.
Claims
1. A method for training a modality classification model, wherein the modality classification model is used to perform modality classification on ultrasound images, characterized in that: The method comprises: Acquire a first ultrasound image dataset and a second ultrasound image dataset, wherein the first ultrasound image dataset includes a plurality of ultrasound images of labeled modality categories, and the second ultrasound image dataset includes a plurality of ultrasound images of unlabeled modality categories; Initialize the teacher modality classification model and the student modality classification model; Using the first ultrasound image data set to perform multiple iterations of training on the teacher modality classification model until convergence; Using the converged teacher modality classification model to label each ultrasound image in the second ultrasound image dataset, and using the labeling result as the label corresponding to each ultrasound image, and each ultrasound image in the second ultrasound image dataset and its corresponding label constitute a second ultrasound image labeling dataset; The first ultrasound image dataset and the second ultrasound image annotation dataset constitute a target ultrasound image dataset, and the student modal classification model is iteratively trained multiple times using the target ultrasound image dataset until convergence, and the converged student modal classification model is used as the modal classification model.
2. The method according to claim 1, characterized in that The ultrasound images in the first ultrasound image data set and the second ultrasound image data set are obtained by dividing multiple existing ultrasound images according to the patient ID division method.
3. The method according to claim 1, characterized in that: The ultrasound images in the first ultrasound image dataset are annotated in the following manner: acquiring a plurality of ultrasound images; Annotating the modality categories of some of the ultrasound images by manual annotation, and constructing a data set based on the annotated results; The deep learning model is iteratively trained multiple times using the data set until convergence, and the converged deep learning model is used to label the modal categories of the remaining ultrasound images. The modal category of each ultrasound image labeled by the deep learning model is then manually labeled to complete the labeling of the remaining ultrasound images.
4. The method according to claim 1, characterized in that: The student modality classification model includes: A data segmentation module, used to perform segmentation processing on each ultrasound image in the target ultrasound image data set, and perform linear transformation on the segmentation result to obtain a feature vector corresponding to each ultrasound image; Multiple self-attention mechanism modules are used to perform self-attention calculation on the feature vector corresponding to each ultrasound image to obtain the attention feature corresponding to each ultrasound image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to a window size of 16x16; A feature transformation module, used for performing a pooling operation on the attention feature corresponding to each ultrasound image output by the last self-attention mechanism module to obtain an intermediate feature corresponding to each ultrasound image; The modality classification module is used to obtain the modality category corresponding to each ultrasound image based on the intermediate features corresponding to each ultrasound image.
5. The method according to claim 1, characterized in that The modality category of each ultrasound image in the first ultrasound image dataset and the second ultrasound image dataset is encoded using a one-hot encoding method to complete the labeling.
6. The method according to claim 5, characterized in that The student modality classification model parameters are updated according to the cross entropy loss during each iterative training process, and the cross entropy loss is: Among them, C is the number of modal categories, y i represents the i-th binary number in the label corresponding to the i-th ultrasound image in the second ultrasound image dataset, represents the modality category prediction value corresponding to the i-th ultrasound image in the second ultrasound image dataset.
7. A modality classification model, the modality classification model is used to perform modality classification on ultrasound images, characterized in that: The model includes: The data segmentation module is used to segment the ultrasound image and perform linear transformation on the segmentation result to obtain the feature vector corresponding to the ultrasound image; Multiple self-attention mechanism modules are used to perform self-attention calculation on the feature vector corresponding to the ultrasound image to obtain the attention feature corresponding to the ultrasound image, wherein the output of the previous self-attention mechanism module is the input of the next self-attention mechanism module, and each self-attention mechanism module is used to perform self-attention calculation on its own input according to a window size of 16x16; A feature transformation module, used for performing a pooling operation on the attention feature corresponding to the ultrasound image output by the last self-attention mechanism module to obtain an intermediate feature corresponding to the ultrasound image; The modality classification module is used to obtain the modality category corresponding to the ultrasound image based on the intermediate features corresponding to the ultrasound image.
8. An application method of a modal classification model, characterized in that: The method comprises: Obtain ultrasound images of breast nodules; The modality classification model training according to claim 7 is used based on the breast nodule ultrasound image to obtain the modality category corresponding to the breast nodule ultrasound image.
9. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method according to any one of claims 1 to 6 and 8 when executing the computer program.
10. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method described in any one of claims 1-6 and 8 is implemented.
Citation Information
Cited By
Copper ore classification method based on lightweight sliding window converter
CN120219862A
