Medical image classification methods, devices, equipment and storage media

By combining the Ghost and transformer modules, the limitations of hardware resources and computational load were resolved, enabling more efficient medical image classification and improving classification results.

CN116580244BActive Publication Date: 2025-11-14PING AN TECH (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310603910.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-25
Publication Date
2025-11-14
Estimated Expiration
2043-05-25

AI Technical Summary

Technical Problem

Existing technologies are limited by hardware resources and computational demands, resulting in medical image classification being based only on CNN or ViT networks, with poor classification performance.

Method used

By combining the Ghost and transformer modules, and through multiple convolutions, scale transformations, stitching, and dimensionality transformations, along with average pooling and multi-head attention mechanisms, we can achieve feature extraction and classification of medical images.

Benefits of technology

While maintaining network accuracy, we can reduce network parameters and computational load, increase computational speed, reduce latency, and improve the accuracy of medical image classification.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116580244B_ABST
    Figure CN116580244B_ABST
Patent Text Reader

Abstract

This application relates to the field of artificial intelligence technology, and provides a medical image classification method, apparatus, device, and storage medium. The method includes: inputting a medical image to be classified into a Ghost module; performing a dimensionality transformation on the medical feature map output by the Ghost module; inputting the dimensionally transformed medical feature map into a transformer module; each transformer module includes an average pooling layer; the average pooling layer is used to perform average pooling on the medical feature map input to the transformer module; and classifying the medical image to be classified using the medical feature map output by the transformer module. Compared with existing methods, the embodiments of the present invention reduce the hardware requirements of the device and achieve better classification results for medical images.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical technology, and in particular to a medical image classification method, apparatus, device, and storage medium. Background Technology

[0002] Medical images are images formed by scanning the human body, a specific part of the body, or human tissue using medical instruments. Examples include CT images obtained from a CT scanner, MRI images obtained from an MRI scanner, and ultrasound images obtained from an ultrasound diagnostic instrument. Additionally, they can include pathological images, etc. In the medical field, the inherent heterogeneity of different symptoms can be reflected in medical images. For example, the appearance (such as shape) of a certain part of the human body can vary to different degrees. Therefore, medical images can serve as a means of medical judgment or a reference factor to assist in clinical diagnosis.

[0003] However, current medical image classification and inference devices are limited in configuration. Due to constraints in hardware resources and computational demands, they can only be implemented using CNN (Convolutional Neural Network) or ViT (Vision Transformer) networks. However, using only CNN or ViT for medical image classification yields poor results. Summary of the Invention

[0004] To address the aforementioned technical problems, the purpose of this application is to provide a medical image classification method, apparatus, device, and storage medium, aiming to solve the technical problem that the current medical image classification can only be achieved based on CNN networks or ViT networks due to limitations in hardware resources and computational load, resulting in poor classification performance.

[0005] In a first aspect, embodiments of the present invention provide a medical image classification method, comprising:

[0006] The medical image to be classified is input into the first Ghost module to obtain the medical feature map output by the first Ghost module;

[0007] The medical feature map output by the first Ghost module is input into the second Ghost module to obtain the medical feature map output by the second Ghost module;

[0008] The medical feature map output by the second Ghost module is subjected to dimensional transformation to obtain the dimensionally transformed medical feature map;

[0009] The medical feature map after dimensional transformation is input into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the first transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation.

[0010] The medical feature map output by the first transformer module is input into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer; the average pooling layer of the second transformer module is used to perform average pooling on the medical feature map output by the first transformer module.

[0011] The medical feature map output by the second transformer module is used to classify the medical image to be classified.

[0012] Furthermore, the step of inputting the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module includes:

[0013] The first medical feature map is obtained by performing N convolutions on the medical image to be classified; where N is a positive integer.

[0014] The first medical feature map is convolved with convolution kernels of different scales to obtain second medical feature maps of different scales;

[0015] The second medical feature maps at different scales are stitched together to obtain the first stitched medical feature map;

[0016] The first stitched medical feature map is used as the medical feature map output by the first Ghost module.

[0017] Furthermore, the step of inputting the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module includes:

[0018] The medical feature map output by the first Ghost module is convolved M times to obtain the third medical feature map; where M is a positive integer.

[0019] The third medical feature map is convolved with convolution kernels of different scales to obtain fourth medical feature maps of different scales;

[0020] The fourth medical feature maps at different scales are stitched together to obtain the second stitched medical feature map;

[0021] The second stitched medical feature map is used as the medical feature map output by the second Ghost module.

[0022] Furthermore, assuming the dimension of the medical feature map output by the second Ghost module is [bs, h, w, c], the step of performing a dimension transformation on the medical feature map output by the second Ghost module to obtain a dimension-transformed medical feature map includes:

[0023] The dimensions [bs, h, w, c] of the medical feature map output by the second Ghost module are transformed into [bs, h*w, c]; where bs is the number of images input to the second Ghost module, h is the width of the medical feature map, w is the height of the medical feature map, and c is the number of feature channels.

[0024] Furthermore, the step of inputting the dimensionally transformed medical feature map into the first transformer module to obtain the medical feature map output by the first transformer module includes:

[0025] The medical feature map after dimensional transformation is averaged by the average pooling layer in the first transformer module to obtain the first average pooled medical feature map.

[0026] Based on the first average pooling medical feature map, a medical feature map output by the first transformer module is generated through a multi-head attention mechanism.

[0027] Furthermore, the step of inputting the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module includes:

[0028] The medical feature map output by the first transformer module is average pooled by the average pooling layer in the second transformer module to obtain the second average pooled medical feature map.

[0029] Based on the second average pooling medical feature map, a medical feature map output by the second transformer module is generated through a multi-head attention mechanism.

[0030] Furthermore, classifying the medical image to be classified using the medical feature map output by the second transformer module includes:

[0031] The average of the h*w dimensions in [bs, h*w, c] is used to obtain a medical feature map with dimensions [bs, c].

[0032] The medical feature maps of [bs, c] are input into a fully connected layer for classification.

[0033] Secondly, embodiments of the present invention provide a medical image classification device, comprising:

[0034] The first input module is used to input the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module;

[0035] The second input module is used to input the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module.

[0036] The dimension transformation module is used to perform dimension transformation on the medical feature map output by the second Ghost module to obtain the dimension-transformed medical feature map.

[0037] The third input module is used to input the medical feature map after dimensional transformation into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation.

[0038] The fourth input module is used to input the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map output by the first transformer module.

[0039] The classification module is used to classify the medical image to be classified using the medical feature map output by the second transformer module.

[0040] Thirdly, embodiments of the present invention provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the medical image classification method as described in any of the preceding claims.

[0041] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the medical image classification method as described in any of the preceding claims.

[0042] Since the Ghost module is a model compression method, it can generate more medical feature maps with fewer parameters. This means that while maintaining network accuracy, it reduces network parameters and computational load, thereby improving computational speed and reducing latency. Furthermore, because the transformer module in this embodiment includes an average pooling layer, the dimensionality of the medical feature maps can be reduced, thus reducing the number of parameters. Therefore, compared to existing methods, this embodiment reduces the hardware requirements. Moreover, since the Ghost module can extract local features, and the transformer module can extract global features, the extracted features possess both global and local information, resulting in better classification performance for medical images. Attached Figure Description

[0043] To more clearly illustrate the technical solution of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0044] Figure 1 This is a flowchart illustrating the medical image classification method provided in the embodiments of this application;

[0045] Figure 2 This is a schematic diagram of the structure of the medical image classification device provided in the embodiments of this application;

[0046] Figure 3 This is a schematic block diagram of the structure of the computer device provided in the embodiments of this application. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this specification means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it can be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein can include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.

[0049] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.

[0050] Example 1:

[0051] The medical image classification method provided below is applied to a medical image classification system, which includes a terminal, a server, and medical instruments. The terminal, server, and medical instruments are connected via a network. The terminal can be a desktop terminal or a mobile terminal; specifically, a mobile terminal can be at least one of a mobile phone, tablet computer, or laptop computer. The server can be a standalone server or a server cluster consisting of multiple servers.

[0052] Medical instruments can include CT (Computed Tomography) machines, MRI (Magnetic Resonance Imaging) equipment, ultrasound diagnostic instruments, X-ray machines, electrocardiogram (ECG) equipment, and electroencephalogram (EEG) equipment, etc. Specifically, the medical image classification method provided in the following embodiments is applied to the terminal or server of a medical image classification system.

[0053] Please see Figure 1 This application provides a medical image classification method, including steps S1-S8:

[0054] S1. Input the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module.

[0055] In this embodiment of the invention, medical images can be images from different data domains, that is, images of different modalities formed by scanning the human body, a certain part of the human body, and human tissues by different medical instruments. Medical images obtained from different medical application scenarios belong to different data domains, and the data domain can indicate that the medical image belongs to a certain medical device or a certain imaging modality.

[0056] For example, in practical applications, medical images can specifically be CT images obtained through CT scans, MRI images obtained through MRI scans, or ultrasound images obtained through ultrasound diagnostic scans. In addition, they can also include X-ray images, electrocardiograms (ECGs), electroencephalograms (EEGs), and pathological images, etc. In the medical field, the inherent heterogeneity of different symptoms can be reflected in medical images. For example, the appearance (such as shape) of a certain part of the human body can vary to different degrees. Therefore, medical images can serve as a means of medical judgment or a reference factor to assist in clinical diagnosis.

[0057] The Ghost module is a model compression method that can generate more medical feature maps with fewer parameters. That is, while ensuring network accuracy, it reduces network parameters and computational load, thereby improving computational speed and reducing latency.

[0058] S2. Input the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module.

[0059] S3. Perform dimensional transformation on the medical feature map output by the second Ghost module to obtain the dimensionally transformed medical feature map.

[0060] In this embodiment of the invention, since the dimension output by the Ghost module is inconsistent with the dimension required as input by the transformer module, it is necessary to transform the dimension output by the Ghost module to conform to the dimension input by the transformer module.

[0061] S4. Input the medical feature map after dimensional transformation into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the first transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation.

[0062] In this embodiment of the invention, it should be understood that the transformer module is also called the transformer model, which is a deep learning model based on the attention mechanism. This embodiment of the invention reduces the dimensionality of the medical feature map by performing average pooling on the dimensionality-transformed medical feature map through an average pooling layer, thereby reducing the number of parameters.

[0063] S5. Input the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer; the average pooling layer of the second transformer module is used to perform average pooling on the medical feature map output by the first transformer module.

[0064] S6. Classify the medical image to be classified using the medical feature map output by the second transformer module.

[0065] In this embodiment of the invention, it is understood that the first Ghost module, the second Ghost module, the first transformer module, and the second transformer module constitute a neural network model. This neural network model is trained using medical image training samples and a preset loss function. For example, the training dataset could be a dataset for determining the cause of brain hemorrhage using CT scans or a three-channel cervical color image staging dataset.

[0066] In this embodiment of the invention, it should be noted that, through experimental verification, the effect of medical image classification using two Ghost modules and two transformer modules is better than that using one Ghost module and one transformer module. Furthermore, image classification can also be achieved using three Ghost modules and three transformer modules, four Ghost modules and four transformer modules, and so on. That is, the number of Ghost modules and transformer modules is determined based on the actual application scenario and experimental data. Therefore, this embodiment of the invention only limits the requirement to at least two Ghost modules and two transformer modules, but does not set an upper limit. It should also be noted that a larger number of Ghost modules and transformer modules is not necessarily better; a larger number of modules will reduce the speed of medical image classification.

[0067] Since the Ghost module is a model compression method, it can generate more medical feature maps with fewer parameters. This means that while maintaining network accuracy, it reduces network parameters and computational load, thereby improving computational speed and reducing latency. Furthermore, because the transformer module in this embodiment includes an average pooling layer, the dimensionality of the medical feature maps can be reduced, thus reducing the number of parameters. Therefore, compared to existing methods, this embodiment reduces the hardware requirements. Moreover, since the Ghost module can extract local features, and the transformer module can extract global features, the extracted features possess both global and local information, resulting in better classification performance for medical images.

[0068] The medical images mentioned can be pathological images. Digital pathological images are obtained by scanning and imaging glass sections (stained tissue sections) frame by frame under a low-power objective lens using a digital microscope or magnification system. Taking breast cancer pathological images as an example, they can be classified into four categories: benign, carcinoma in situ, invasive carcinoma, and normal. Specifically, breast cancer pathological images are classified based on characteristics such as texture, color, and shape.

[0069] In one embodiment, the step of inputting the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module includes steps S21-S24:

[0070] S21. Perform N convolutions on the medical image to be classified to obtain the first medical feature map; where N is a positive integer;

[0071] S22. Convolve the first medical feature map using convolution kernels of different scales to obtain second medical feature maps of different scales;

[0072] S23. The second medical feature maps at different scales are stitched together to obtain the first stitched medical feature map;

[0073] S24. Use the first stitched medical feature map as the medical feature map output by the first Ghost module.

[0074] In this embodiment of the invention, the medical image to be classified is convolved N times. The number of convolutions here is less than the number of traditional convolutions. For example, if traditional convolution requires 128 convolutions, then N is less than 128.

[0075] The number of convolutions used in this embodiment of the invention is less than that of traditional convolutions. Furthermore, by using convolution kernels of different scales to convolve the first medical feature map, second medical feature maps of different scales are obtained. In this way, the amount of computation can be reduced while generating a large number of medical feature maps.

[0076] In one embodiment, the step of inputting the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module includes steps S31-S34:

[0077] S31. Perform M convolutions on the medical feature map output by the first Ghost module to obtain the third medical feature map; where M is a positive integer;

[0078] S32. Convolve the third medical feature map using convolution kernels of different scales to obtain fourth medical feature maps of different scales;

[0079] S33. The fourth medical feature maps of different scales are stitched together to obtain a second stitched medical feature map;

[0080] S34. Use the second spliced ​​medical feature map as the medical feature map output by the second Ghost module.

[0081] In this embodiment of the invention, the number of convolutions M is less than the number of convolutions in a traditional convolution. For example, if a traditional convolution requires 128 convolutions, then M is less than 128. The number of convolutions N and M can be the same or different, and this embodiment of the invention does not impose any restrictions on this.

[0082] The number of convolutions used in this embodiment of the invention is less than that of traditional convolutions. Furthermore, by using convolution kernels of different scales to convolve the third medical feature map, fourth medical feature maps of different scales are obtained. In this way, the amount of computation can be reduced while generating a large number of medical feature maps.

[0083] In one embodiment, assuming the dimension of the medical feature map output by the second Ghost module is [bs, h, w, c], the step of performing a dimension transformation on the medical feature map output by the second Ghost module to obtain a dimension-transformed medical feature map includes:

[0084] The dimensions [bs, h, w, c] of the medical feature map output by the second Ghost module are transformed into [bs, h*w, c]; where bs is the number of images input to the second Ghost module, h is the width of the medical feature map, w is the height of the medical feature map, and c is the number of feature channels.

[0085] In this embodiment of the invention, since the dimension output by the Ghost module is inconsistent with the dimension required as input by the transformer module, it is necessary to transform the dimension output by the Ghost module to conform to the dimension input by the transformer module.

[0086] In one embodiment, the step of inputting the dimensionally transformed medical feature map into a first transformer module to obtain the medical feature map output by the first transformer module includes steps S41-S42:

[0087] S41. The medical feature map after dimensional transformation is averaged through the average pooling layer in the first transformer module to obtain the first average pooled medical feature map.

[0088] S42. Based on the first average pooling medical feature map, generate the medical feature map output by the first transformer module through a multi-head attention mechanism.

[0089] In this embodiment of the invention, the transformer module further includes an average pooling layer, which can reduce the dimension of the medical feature map, that is, reduce the number of parameters.

[0090] In one embodiment, the step of inputting the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module includes steps S51-S52:

[0091] S51. The medical feature map output by the first transformer module is average pooled through the average pooling layer in the second transformer module to obtain the second average pooled medical feature map.

[0092] S52. Based on the second average pooling medical feature map, generate the medical feature map output by the second transformer module through a multi-head attention mechanism.

[0093] In this embodiment of the invention, the transformer module further includes an average pooling layer, which can reduce the dimension of the medical feature map, that is, reduce the number of parameters.

[0094] In one embodiment, classifying the medical image to be classified using the medical feature map output by the second transformer module includes steps S61-S62:

[0095] S61. Take the average of the h*w dimensions in [bs, h*w, c] to obtain a medical feature map with dimensions [bs, c].

[0096] S62. Input the medical feature map of [bs, c] into the fully connected layer for classification.

[0097] In this embodiment of the invention, assuming h*w is a 10-dimensional vector, averaging this 10-dimensional vector yields a number, i.e., the dimension becomes 1. This dimension can then be deleted, resulting in [bs, c]. Furthermore, assuming we want to classify K classes, we only need to add a fully connected layer to obtain (bs, K).

[0098] Implementation List 2:

[0099] Please see Figure 2 This invention provides a medical image classification device, comprising:

[0100] The first input module 1 is used to input the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module;

[0101] The second input module 2 is used to input the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module;

[0102] Dimension transformation module 3 is used to perform dimension transformation on the medical feature map output by the second Ghost module to obtain the dimension-transformed medical feature map;

[0103] The third input module 4 is used to input the medical feature map after dimensional transformation into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation.

[0104] The fourth input module 5 is used to input the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map output by the first transformer module.

[0105] Classification module 6 is used to classify the medical image to be classified using the medical feature map output by the second transformer module.

[0106] In one embodiment, the step of inputting the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module includes:

[0107] The first medical feature map is obtained by performing N convolutions on the medical image to be classified; where N is a positive integer.

[0108] The first medical feature map is convolved with convolution kernels of different scales to obtain second medical feature maps of different scales;

[0109] The second medical feature maps at different scales are stitched together to obtain the first stitched medical feature map;

[0110] The first stitched medical feature map is used as the medical feature map output by the first Ghost module.

[0111] In one embodiment, the step of inputting the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module includes:

[0112] The medical feature map output by the first Ghost module is convolved M times to obtain the third medical feature map; where M is a positive integer.

[0113] The third medical feature map is convolved with convolution kernels of different scales to obtain fourth medical feature maps of different scales;

[0114] The fourth medical feature maps at different scales are stitched together to obtain the second stitched medical feature map;

[0115] The second stitched medical feature map is used as the medical feature map output by the second Ghost module.

[0116] In one embodiment, assuming the dimensions of the medical feature map output by the second Ghost module are [bs, h, w, c], then the step of performing dimensional transformation on the medical feature map output by the second Ghost module to obtain the dimensionally transformed medical feature map includes:

[0117] The dimensions [bs, h, w, c] of the medical feature map output by the second Ghost module are transformed into [bs, h*w, c]; where bs is the number of images input to the second Ghost module, h is the width of the medical feature map, w is the height of the medical feature map, and c is the number of feature channels.

[0118] In one embodiment, the step of inputting the dimensionally transformed medical feature map into a first transformer module to obtain the medical feature map output by the first transformer module includes:

[0119] The medical feature map after dimensional transformation is averaged by the average pooling layer in the first transformer module to obtain the first average pooled medical feature map.

[0120] Based on the first average pooling medical feature map, a medical feature map output by the first transformer module is generated through a multi-head attention mechanism.

[0121] In one embodiment, the step of inputting the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module includes:

[0122] The medical feature map output by the first transformer module is average pooled by the average pooling layer in the second transformer module to obtain the second average pooled medical feature map.

[0123] Based on the second average pooling medical feature map, a medical feature map output by the second transformer module is generated through a multi-head attention mechanism.

[0124] In one embodiment, classifying the medical image to be classified using the medical feature map output by the second transformer module includes:

[0125] The average of the h*w dimensions in [bs, h*w, c] is used to obtain a medical feature map with dimensions [bs, c].

[0126] The medical feature maps of [bs, c] are input into a fully connected layer for classification.

[0127] It should be understood that the image classification device provided in this application embodiment has the same concept as the above-described medical image classification method, and the specific implementation method is the same. The embodiments of this invention will not be described in detail.

[0128] Example 3:

[0129] Reference Figure 3 The present invention also provides a computer device, the internal structure of which can be as follows: Figure 3As shown, the computer device includes a processor, memory, network interface, and database connected via a system bus. The processor is designed to provide computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores operating devices, computer programs, and the database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores data such as a medical image classification method. The network interface is used for communication with external terminals via a network connection. Furthermore, the computer device may also include input devices and a display screen. When the aforementioned computer program is executed by a processor, it implements a medical image classification method, comprising the following steps: inputting the medical image to be classified into a first Ghost module to obtain a medical feature map output by the first Ghost module; inputting the medical feature map output by the first Ghost module into a second Ghost module to obtain a medical feature map output by the second Ghost module; performing a dimensional transformation on the medical feature map output by the second Ghost module to obtain a dimensionally transformed medical feature map; inputting the dimensionally transformed medical feature map into a first transformer module to obtain a medical feature map output by the first transformer module; wherein, the first transformer module includes an average pooling layer, which is used to perform average pooling on the dimensionally transformed medical feature map; inputting the medical feature map output by the first transformer module into the second transformer module to obtain a medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer; the average pooling layer of the second transformer module is used to perform average pooling on the medical feature map output by the first transformer module; and classifying the medical image to be classified using the medical feature map output by the second transformer module. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer equipment on which the present application is applied.

[0130] Since the Ghost module is a model compression method, it can generate more medical feature maps with fewer parameters. This means that while maintaining network accuracy, it reduces network parameters and computational load, thereby improving computational speed and reducing latency. Furthermore, because the transformer module in this embodiment includes an average pooling layer, the dimensionality of the medical feature maps can be reduced, thus reducing the number of parameters. Therefore, compared to existing methods, this embodiment reduces the hardware requirements. Moreover, since the Ghost module can extract local features, and the transformer module can extract global features, the extracted features possess both global and local information, resulting in better classification performance for medical images.

[0131] One embodiment of this application also provides a computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements a medical image classification method, comprising the following steps: inputting a medical image to be classified into a first Ghost module to obtain a medical feature map output by the first Ghost module; inputting the medical feature map output by the first Ghost module into a second Ghost module to obtain a medical feature map output by the second Ghost module; performing a dimensional transformation on the medical feature map output by the second Ghost module to obtain a dimensionally transformed medical feature map; and inputting the dimensionally transformed medical feature map into a first transformer module to obtain a medical feature map output by the first transformer module. The process involves: 1) A medical feature map is generated; 2) The first transformer module includes an average pooling layer, which performs average pooling on the medical feature map after dimensional transformation; 3) The medical feature map output by the first transformer module is input into a second transformer module to obtain a medical feature map output by the second transformer module; 4) The second transformer module includes an average pooling layer, which performs average pooling on the medical feature map output by the first transformer module; 5) The medical feature map output by the second transformer module is used to classify the medical image to be classified.

[0132] Since the Ghost module is a model compression method, it can generate more medical feature maps with fewer parameters. This means that while maintaining network accuracy, it reduces network parameters and computational load, thereby improving computational speed and reducing latency. Furthermore, because the transformer module in this embodiment includes an average pooling layer, the dimensionality of the medical feature maps can be reduced, thus reducing the number of parameters. Therefore, compared to existing methods, this embodiment reduces the hardware requirements. Moreover, since the Ghost module can extract local features, and the transformer module can extract global features, the extracted features possess both global and local information, resulting in better classification performance for medical images.

[0133] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this application and in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0134] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.

[0135] The above description is merely a preferred embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A medical image classification method, characterized in that, include: The medical image to be classified is input into the first Ghost module to obtain the medical feature map output by the first Ghost module; The medical feature map output by the first Ghost module is input into the second Ghost module to obtain the medical feature map output by the second Ghost module; The medical feature map output by the second Ghost module is subjected to dimensional transformation to obtain the dimensionally transformed medical feature map; The medical feature map after dimensional transformation is input into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the first transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation. The medical feature map output by the first transformer module is input into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer; the average pooling layer of the second transformer module is used to perform average pooling on the medical feature map output by the first transformer module. The medical feature map output by the second transformer module is used to classify the medical image to be classified.

2. The medical image classification method according to claim 1, characterized in that, The step of inputting the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module includes: The first medical feature map is obtained by performing N convolutions on the medical image to be classified; where N is a positive integer. The first medical feature map is convolved with convolution kernels of different scales to obtain second medical feature maps of different scales; The second medical feature maps at different scales are stitched together to obtain the first stitched medical feature map; The first stitched medical feature map is used as the medical feature map output by the first Ghost module.

3. The medical image classification method according to claim 1, characterized in that, The step of inputting the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module includes: The medical feature map output by the first Ghost module is convolved M times to obtain the third medical feature map; where M is a positive integer. The third medical feature map is convolved with convolution kernels of different scales to obtain fourth medical feature maps of different scales; The fourth medical feature maps at different scales are stitched together to obtain the second stitched medical feature map; The second stitched medical feature map is used as the medical feature map output by the second Ghost module.

4. The medical image classification method according to claim 1, characterized in that, Let the dimensions of the medical feature map output by the second Ghost module be [bs, h, w, c]. The step of performing dimensional transformation on the medical feature map output by the second Ghost module to obtain the dimensionally transformed medical feature map includes: The dimensions [bs, h, w, c] of the medical feature map output by the second Ghost module are transformed into [bs, h*w, c]; where bs is the number of images input to the second Ghost module, h is the width of the medical feature map, w is the height of the medical feature map, and c is the number of feature channels.

5. The medical image classification method according to claim 1, characterized in that, The step of inputting the dimensionally transformed medical feature map into the first transformer module to obtain the medical feature map output by the first transformer module includes: The medical feature map after dimensional transformation is averaged by the average pooling layer in the first transformer module to obtain the first average pooled medical feature map. Based on the first average pooling medical feature map, a medical feature map output by the first transformer module is generated through a multi-head attention mechanism.

6. The medical image classification method according to claim 1, characterized in that, The step of inputting the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module includes: The medical feature map output by the first transformer module is average pooled by the average pooling layer in the second transformer module to obtain the second average pooled medical feature map. Based on the second average pooling medical feature map, a medical feature map output by the second transformer module is generated through a multi-head attention mechanism.

7. The medical image classification method according to claim 4, characterized in that, The step of classifying the medical image to be classified using the medical feature map output by the second transformer module includes: The average of the h*w dimensions in [bs, h*w, c] is used to obtain a medical feature map with dimensions [bs, c]. The medical feature maps of [bs, c] are input into a fully connected layer for classification.

8. A medical image classification device, characterized in that, include: The first input module is used to input the medical image to be classified into the first Ghost module to obtain the medical feature map output by the first Ghost module; The second input module is used to input the medical feature map output by the first Ghost module into the second Ghost module to obtain the medical feature map output by the second Ghost module; The dimension transformation module is used to perform dimension transformation on the medical feature map output by the second Ghost module to obtain the dimension-transformed medical feature map. The third input module is used to input the medical feature map after dimensional transformation into the first transformer module to obtain the medical feature map output by the first transformer module; wherein, the transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map after dimensional transformation. The fourth input module is used to input the medical feature map output by the first transformer module into the second transformer module to obtain the medical feature map output by the second transformer module; wherein, the second transformer module includes an average pooling layer, which is used to perform average pooling on the medical feature map output by the first transformer module. The classification module is used to classify the medical image to be classified using the medical feature map output by the second transformer module.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the medical image classification method as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the medical image classification method as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Image classification method and device, equipment and storage medium

    CN115423754A

  • Endoscope image feature learning model training method and apparatus, and endoscope image classification model training method and apparatus

    WO2023071680A1