CT image classification method based on multi-example contrast learning and transformer technology

CN117611916BActive Publication Date: 2026-10-27UNIV OF SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311730895.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-15
Publication Date
2026-10-27
Estimated Expiration
2043-12-15

AI Technical Summary

Technical Problem

一方面,病例数据的稀缺和肿瘤的异质性导致现有方法难以提取有判别力的特征,使得模型泛化能力差,实际性能不佳

Benefits of technology

[0055]1.本发明方法首先提出了一种面向示例的增强对比学习方法,通过鼓励模型学习正负示例间的特征相似性与差异性,以提取有判别力的示例特征。此外,该方法还采用了示例选择策略来筛选含有丰富信息的示例,提升了在对比学习中有价值示例信息的利用,增强了分类模型的泛化能力,从而有利于提高分类结果的准确性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117611916B_ABST
    Figure CN117611916B_ABST
Patent Text Reader

Abstract

The application discloses a CT image classification method based on multi-example contrast learning and a Transformer technology, and comprises the following steps: acquiring lung CT image data and performing pretreatment; 2, a feature extractor is trained by using an example enhancement contrast learning method to extract discriminative example features; 3, the trained feature extractor is used for example feature extraction, and a local-global Transformer module is used to capture global and local information; 4, a loss function is constructed, and a classification model is trained to obtain a trained classification model. The application can obtain discriminative example features and fully capture and utilize global information and local information in the CT image, so that the accuracy of lung CT image classification is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of CT image classification technology, specifically a CT image classification method based on multi-instance comparative learning and Transformer technology. Background Technology

[0002] The goal of lung CT image classification is to accurately classify abnormalities in lung CT images using computer-aided diagnosis, i.e., to determine the category of the abnormality. This is of great significance in helping doctors develop targeted treatment plans and prolong patient survival, thus having broad clinical application value. Invasive biopsy is the "gold standard" for detecting non-small cell lung cancer (NSCLC), but it has many drawbacks such as being invasive and high-risk. Therefore, many researchers in the field of medical imaging use CT images for NSCLC subtype classification studies.

[0003] However, existing methods for classifying abnormal lung regions based on CT images still have certain limitations. Current methods primarily employ fully supervised learning, aiming to establish a global correlation between classification results and CT images. In practical clinical applications, non-small cell lung cancer detection typically involves biopsy or surgery, thus the results are subject to limitations imposed by factors such as sampling method and sampling area. Even if the detection results are confirmed, the outcome for unsampled areas remains unknown. This means that classification methods do not satisfy a global correspondence between images and gene mutation states; therefore, fully supervised learning is not the optimal approach for CT image classification.

[0004] Multiple instance learning (MIM) is a weakly supervised learning method that has seen rapid development in recent years. Unlike fully supervised learning methods, MIM can train models with only bag-level labels and no instance-level labels, making it a better solution for CT image classification tasks. However, directly applying traditional MIM methods to CT image classification tasks still presents two main problems. First, the scarcity of case data and the heterogeneity of tumors make it difficult for existing methods to extract discriminative features, resulting in poor model generalization ability and unsatisfactory practical performance. Second, most existing methods use convolutional neural networks to learn local details such as tumor shape, edges, and texture. Their limited receptive field makes it difficult to acquire global information about the complete lesion area, hindering the understanding of the spatial relationship between the tumor and surrounding tissues. This makes it difficult to learn comprehensive feature representations, reducing the model's classification performance. Summary of the Invention

[0005] This invention presents a novel CT image classification method based on multi-instance contrastive learning and Transformer technology. Unlike existing CT image classification methods, this method proposes a CT image classification method based on local-global Transformer multi-instance contrastive learning, aiming to obtain discriminative instance features and fully capture and utilize global and local information in CT images, thereby improving the accuracy of CT image classification.

[0006] To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0007] The CT image classification method based on multi-instance contrastive learning and Transformer technology of the present invention is characterized by the following steps:

[0008] Step 1: Acquire lung CT image data and perform preprocessing;

[0009] Obtain lung CT image data for N cases with category labels. Resample the lung CT image data using trilinear interpolation to adjust the voxel size, and then perform pixel intensity cropping to obtain a set of lung CT slices for each case and its corresponding category label, denoted as . Among them, X t Let X represent the set of lung CT slices for the t-th case, and X... t ={x t,j |j=1,2,…,J t}, x t,j J represents the j-th lung image of the t-th case. t y represents the number of lung images in the set of lung CT slices for the t-th case. t X represents the set of CT slices for the t-th case. t The corresponding category labels; t = 1, 2, ..., N; N represents the number of cases;

[0010] With X t The middle one in Images of the lungs Using the center slice as the origin, sample n lung images adjacent to the center slice on the left and right, thus obtaining 2n+1 lung images for the t-th case and forming the lung image set X′ for the t-th case. t ;in, Indicates rounding up.

[0011] X′ t Let x′ be any l-th lung image in the dataset. t,l ∈R C×H×W C, H, and W represent the number of channels, height, and width of the lung image, respectively; l∈{tn,t,t+n};

[0012] Step 2: Use a sliding window with length × width h × w to measure x′ t,l After segmentation, we obtain M lung examples with dimensions h×w, where any v-th lung example is denoted as... Use the example selection strategy to select all lung examples Divide into K categories;

[0013] Step 3: Extract the vth lung example using the feature extractor. Lung coding feature map

[0014] Step 4: Build a local-global Transformer module to capture Global information feature map and local information feature map

[0015] Step 5: Construct an example aggregation network consisting of C4 fusion modules and I4 multilayer sensing mechanisms, and obtain the network using equation (10). Predicted category labels

[0016]

[0017] In equation (10), MLP represents a multilayer perceptron, and mp represents the... Mapping to Same dimension;

[0018] Step 5.1: Construct and train a CT image classification network consisting of a local-global Transformer and an example aggregation module;

[0019] Step 5.2: Construct the overall loss function L for multi-example contrastive learning of the t-th case using equation (11). t,total ;

[0020]

[0021] Step 5.3: Based on a set of labeled lung CT slices The CT image classification network was trained with an initial learning rate l1, and the overall loss function L was calculated. t,total To update the network parameters, when the number of training steps reaches t1, the CT image classification network is trained again according to the learning rate l2 until the total number of training steps is reached, thereby obtaining a trained CT image classification network, which is used to classify lung CT images.

[0022] The CT image classification method based on multi-instance contrastive learning and Transformer technology described in this invention is also characterized in that step 2 includes:

[0023] Step 2.1: Define the current iteration number as t, and initialize t = 0;

[0024] Step 2.2: Randomly select K cluster centers in the t-th iteration, denoted as Kt. in, This represents the k-th cluster center in the t-th iteration;

[0025] Step 2.3: Using formula (1), the vth lung example Assigned to the category of the nearest center

[0026]

[0027] Step 2.4: Calculate the category in the (t+1)th iteration using equation (2). Cluster center

[0028]

[0029] In equation (2), Indicates category Cluster centers;

[0030] Step 2.5: Construct the loss function for the (t+1)th iteration using equation (3).

[0031]

[0032] In equation (3), Let represent the sum of squared errors in the distances of all lung examples to their respective cluster centers in the (t+1)th iteration;

[0033] Step 2.6, Judgment Whether it converges; if it converges, it means that all lung samples are included. Divide into K categories; otherwise, assign t+1 to t and return to steps 2.3-2.5 in sequence.

[0034] Step 3 includes:

[0035] Step 3.1: Construct an example feature extractor consisting of C1 convolutional layers, I1 Inception layers, and P1 max pooling layers; each Inception layer consists of I2 convolutional layers; and set the activation function of all convolutional layers to the ReLU function.

[0036] Step 3.2, The input is fed into the example feature extractor and processed through C1 convolutional layers to obtain the convolutional feature vector. After passing through I1 Inception layers and P1 max pooling layers, the lung coding feature map is obtained.

[0037] Step 3.3: Randomly select the i-th lung example from the K categories. will with Other examples belonging to the same category To construct positive example pairs, which will be with Belonging to different categories To construct negative example pairs, and thus construct the i-th lung example using equation (4). Contrast loss function

[0038]

[0039] In equation (4), Indicates calculation and Cosine similarity; τ is the temperature coefficient, 1 v≠i ∈{0,1} is an index function. If v≠i, then let 1 v≠i Let it be 1, otherwise let it be 1. v≠i It is 0.

[0040] Step 4 includes:

[0041] The local module consists of N1 cascaded convolutional neural networks f τ Each convolutional neural network consists of C2 convolutional layers and I2 Inception layers, with the activation function of all convolutional layers set to the ReLU function.

[0042] The global module consists of N2 cascaded self-attention networks, and each self-attention network consists of C3 multi-head attention modules and I3 multilayer perception mechanisms;

[0043] The input is fed into a local module and passes through N1 cascaded convolutional neural networks f. τ The feature maps obtained are processed and combined with N2 cascaded self-attention networks. By performing fusion, a feature map containing local information can be obtained using equation (5).

[0044]

[0045] In equation (5), n1∈{1,N1}, n2∈{1,N2}, This represents the feature map output by the n1th cascaded convolutional neural network. This represents the feature map output by the (n1-1)th cascaded convolutional neural network. Let the feature map be the output of the (n2-1)th self-attention network. When n1 = 1, let...

[0046] The input is fed into the global module and processed through N2 cascaded self-attention networks (MSA), and then combined with N1 cascaded convolutional neural networks (f). τ The obtained feature map By performing fusion, feature maps containing global information can be obtained using equations (6) to (9).

[0047]

[0048]

[0049]

[0050]

[0051] In equations (6) to (9), when n2 = 1, let W represents the query matrix obtained after passing through the n2th self-attention network. Q Indicates the use of calculation The weight matrix, W represents the key matrix obtained after passing through the n2th self-attention network. k Indicates the use of calculation The weight matrix, W represents the value matrix obtained after passing through the n2-th self-attention network. V Indicates the use of calculation The weight matrix, This represents the multi-head self-attention mechanism of the n2-th self-attention network, where SA is the self-attention layer, softmax is the activation function, and d q yes In the dimension of , MSA represents multi-head self-attention, LN represents layer normalization, Concat represents fusion, and W O This represents the output weight matrix.

[0052] The present invention provides an electronic device, including a memory and a processor, wherein the memory is used to store a program that supports the processor in executing the CT image classification method, and the processor is configured to execute the program stored in the memory.

[0053] The present invention discloses a computer-readable storage medium on which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of the CT image classification method.

[0054] Compared with the prior art, the beneficial effects of the present invention are as follows:

[0055] 1. The present invention first proposes an example-oriented augmented contrastive learning method, which encourages the model to learn the feature similarities and differences between positive and negative examples to extract discriminative example features. Furthermore, this method employs an example selection strategy to filter examples containing rich information, improving the utilization of valuable example information in contrastive learning, enhancing the generalization ability of the classification model, and thus contributing to improved accuracy of classification results.

[0056] 2. This invention further designs a novel local-global Transformer module, which provides comprehensive feature representations for multi-instance learning by fully capturing global and local information from CT images. Furthermore, to enhance local and global feature representations, this module employs feature interaction technology to facilitate information exchange between the two branches, providing comprehensive and complementary CT image features. This enables the model to learn global and local information more fully, thereby effectively improving classification performance. Attached Figure Description

[0057] Figure 1 This is a schematic diagram of the process of the present invention;

[0058] Figure 2 This is a schematic diagram of the classification model of the present invention. Detailed Implementation

[0059] In this embodiment, a CT image classification method based on multi-instance contrastive learning and Transformer technology is described, such as... Figure 1 As shown, the procedure is as follows:

[0060] Step 1: Acquire lung CT image data and perform preprocessing;

[0061] Obtain lung CT image data for N cases with category labels. Resample the lung CT image data using trilinear interpolation to adjust the voxel size, and then perform pixel intensity cropping to obtain a set of lung CT slices for each case and its corresponding category label, denoted as . Among them, X t Let X represent the set of lung CT slices for the t-th case, and X... t ={x t,j |j=1,2,…,J t}, x t,j J represents the j-th lung image of the t-th case.t y represents the number of lung images in the set of lung CT slices for the t-th case. t X represents the set of CT slices for the t-th case. t The corresponding category label; t = 1, 2, ..., N; N represents the number of cases; In this embodiment, CT images of 420 lung cancer patients were collected as a sample set. The CT images were resampled to adjust their voxel size to 1mm × 1mm × 1mm, and their pixel intensity was clipped to -1000 to 400 HU.

[0062] With X t The middle one in Images of the lungs Slice the slice with the center as the center, where, This represents rounding up. Taking the center of the abnormal location in the central slice as the origin, n lung images adjacent to the left and right of the central slice are sampled to obtain 2n+1 lung images for the t-th case. The set of lung images for the t-th case is denoted as X′. t ;

[0063] X′ t Let x′ be any l-th lung image in the dataset. t,l ∈R C×H×W C, H, and W represent the number of channels, height, and width of the lung image, respectively; l∈{tn,t,t+n}; in this embodiment, n is 1, H and W are both 224, and C is 1; the pixel value range of the CT image is adjusted to [0,1] by mean normalization, and then random flipping (including vertical flipping and horizontal flipping) and random rotation {90°,180°,270°,360°} are used to augment the training set images.

[0064] Step 2: Use a sliding window with length × width h × w to measure x′ t,l After segmentation, we obtain M lung examples with dimensions h×w, where any v-th lung example is denoted as... Use the example selection strategy to select all lung examples The images are divided into K categories; in this embodiment, K is 4, h is 16, w is 16, and M is 196, so that each lung image can be divided into exactly 196 examples.

[0065] Step 2.1: Define the current iteration number as t, and initialize t = 0;

[0066] Step 2.2: Randomly select K cluster centers in the t-th iteration, denoted as Kt. in, This represents the k-th cluster center in the t-th iteration;

[0067] Step 2.3: Using formula (1), the vth lung example Assigned to the category of the nearest center

[0068]

[0069] Step 2.4: Calculate the category in the (t+1)th iteration using equation (2). Cluster center

[0070] In equation (2), Indicates category Cluster centers;

[0071] Step 2.5: Construct the loss function for the (t+1)th iteration using equation (3).

[0072]

[0073] In equation (3), Let represent the sum of squared errors in the distances of all lung examples to their respective cluster centers in the (t+1)th iteration.

[0074] Step 2.6, Judgment Whether it converges; if it converges, it means that all lung samples are included. Divide into K categories; otherwise, assign t+1 to t and return to steps 2.3-2.5 in sequence.

[0075] Step 3, as follows Figure 2 As shown, a feature extractor is used to extract discriminative example features;

[0076] Step 3.1: Construct an example feature extractor consisting of C1 convolutional layers, I1 Inception layers, and P1 max pooling layers; each Inception layer consists of I2 convolutional layers; in this embodiment, C1 is 2, P1 is 1, I1 is 4, and I2 is 2; and the activation function of all convolutional layers is set to the ReLU function.

[0077] Step 3.2, The input is fed into the example feature extractor and processed through C1 convolutional layers to obtain the convolutional feature vector. After passing through I1 Inception layers and P1 max pooling layers, the lung coding feature map is obtained.

[0078] Step 3.3: Randomly select the i-th lung example from the K categories. will with Other examples belonging to the same category To construct positive example pairs, which will be with Belonging to different categories To construct negative example pairs, and thus construct the i-th lung example using equation (4). Contrast loss function

[0079]

[0080] In equation (4), Indicates calculation and Cosine similarity; τ is the temperature coefficient, 1 v≠i ∈{0,1} is an index function. If v≠i, then let 1 v≠i Let it be 1, otherwise let it be 1. v≠i It is 0.

[0081] Step 4: Build a local-global Transformer module to capture global and local information;

[0082] The local module consists of N1 cascaded convolutional neural networks f τ The structure consists of C2 convolutional layers and I2 Inception layers. In this embodiment, N1 is 2, C2 is 2, I2 is 2, the stride of all convolutional layers is 1, and the activation function of all convolutional layers is set to the ReLU function.

[0083] The global module consists of N2 cascaded self-attention networks, and each self-attention network consists of C3 multi-head attention modules and I3 multilayer perception mechanisms; in this embodiment, N2 is 2, C3 is 1, and I3 is 1.

[0084] The input is fed into a local module and passes through N1 cascaded convolutional neural networks f. τ The feature maps obtained are processed and combined with N2 cascaded self-attention networks. By performing fusion, a feature map containing local information can be obtained using equation (5).

[0085]

[0086] In equation (5), n1∈{1,N1}, n2∈{1,N2}, This represents the feature map output by the n1th cascaded convolutional neural network. This represents the feature map output by the (n1-1)th cascaded convolutional neural network. Let the feature map be the output of the (n2-1)th self-attention network. When n1 = 1, let...

[0087] The input is fed into the global module and processed through N2 cascaded self-attention networks (MSA), and then combined with N1 cascaded convolutional neural networks (f). τ The obtained feature map By performing fusion, feature maps containing global information can be obtained using equations (6) to (9).

[0088]

[0089]

[0090]

[0091]

[0092] In equations (6) to (9), when n2 = 1, let W represents the query matrix obtained after passing through the n2th self-attention network. Q Indicates the use of calculation The weight matrix, W represents the key matrix obtained after passing through the n2th self-attention network. K Indicates the use of calculation The weight matrix, W represents the value matrix obtained after passing through the n2-th self-attention network. V Indicates the use of calculation The weight matrix, This represents the multi-head self-attention mechanism of the n2-th self-attention network, where SA is the self-attention layer, softmax is the activation function, and d q yes In the dimension of , MSA represents multi-head self-attention, LN represents layer normalization, Concat represents fusion, and W O This represents the output weight matrix.

[0093] From equations (5) to (9), it can be seen that the encoded feature map obtained by the example feature extractor... The data is fed into the local-global Transformer module. After the local and global modules learn from the local and global information, the local feature map is finally obtained. and global feature map

[0094] As can be seen from equations (5) and (9), the input of each level in the local module consists of two parts: the input of the local module at the previous level. Input from the previous global module The input at each level in the global module consists of two parts: the input from the local module at the next higher level. Input from the previous global module

[0095] The encoded feature map obtained through the example feature extractor The data is fed into the local-global Transformer module. After the local and global modules learn from the local and global information, the local feature map is finally obtained. and global feature map

[0096] Step 5: Construct an example aggregation network consisting of C4 fusion modules and I4 multilayer sensing mechanisms. In this embodiment, C4 is set to 1 and I4 is set to 1, and the network is obtained using equation (10). Predicted category labels

[0097]

[0098] In equation (10), mp is used to map the size of the global feature map to the local feature map. Figure 1 This provides several dimensions to facilitate the subsequent fusion process. Concat is used to fuse local and global features.

[0099] Step 5.1: Construct and train a CT image classification network consisting of a local-global Transformer and an example aggregation network;

[0100] Step 5.2: Construct the overall loss function L for multi-example contrastive learning of the t-th case using equation (11). t,total ;

[0101]

[0102] Step 5.3: Based on a set of labeled lung CT slices The CT image classification network was trained with an initial learning rate l1, and the overall loss function L was calculated. t,total To update the network parameters, when the number of training steps reaches t1, the CT image classification network is trained again according to the learning rate l2 until the total number of training steps is reached, thereby obtaining a trained CT image classification model, which is used to classify lung CT images.

[0103] In this embodiment, the number of non-small cell lung cancer patient samples collected each time during training is set to 8; l1 is set to 10. -4 ; t1 is 100, l2 is 10 -5 T is set to 150.

[0104] In this embodiment, an electronic device includes a memory and a processor. The memory stores a program that supports the processor in executing the above-described method, and the processor is configured to execute the program stored in the memory.

[0105] In this embodiment, a computer-readable storage medium stores a computer program, which is executed by a processor to perform the steps of the above method.

Claims

1. A CT image classification method based on multi-instance contrastive learning and Transformer technology, characterized in that, Includes the following steps: Step 1: Acquire lung CT image data and perform preprocessing; Get with category labels N The lung CT image data of each case was collected, and the lung CT image data were resampled using trilinear interpolation to adjust the voxel size, followed by pixel intensity cropping, to obtain the lung CT slice set and its corresponding category label for each case, denoted as . ,in, Indicates the first A collection of lung CT slices from each case, and ={ }, Indicates the first The first case Images of the lungs. Indicates the first The number of lung images in the lung CT slice set of each case. Indicates the first CT slice collection of individual cases Corresponding category tags; N represents the number of cases; by The middle one in Images of the lungs Using the center slice as the origin, and taking the center of the anomaly location in the center slice as the origin, samples are taken from the left and right adjacent slices of the center slice. Zhang's lung images, thus obtaining the first One case Zhang's lung images and their composition A collection of lung images from individual cases. ;in, Indicates rounding up. Will Any of the following The lung images are recorded as C, H, and W represent the number of channels, height, and width of the lung image, respectively; ; Step 2: Using length × width Sliding window Segmentation is performed to obtain Each dimension is Examples of lungs, where any first One example of a lung is denoted as ; and use the example selection strategy to select all lung examples { | v =1,2,…, } divided into One category; Step 3: Extract the first feature using a feature extractor. Example of a lung Lung coding feature map The feature extractor is trained using an example-enhanced contrastive learning method to extract discriminative example features. Step 4: Build a local-global Transformer module to capture Global information feature map and local information feature map ; Local modules are composed of A series of cascaded convolutional neural networks Each convolutional neural network consists of... Each convolutional layer There are one Inception layer, and the activation function of all convolutional layers is set to the ReLU function; The global module is composed of It consists of cascaded self-attention networks, each of which is composed of... A multi-head attention module and A multi-layered sensing mechanism; Input into the local module, and then... A series of cascaded convolutional neural networks The processing, and with Feature maps obtained from cascaded self-attention networks By performing fusion, a feature map containing local information can be obtained using equation (5). = : (5) In equation (5), , , Indicates the first Feature maps output by cascaded convolutional neural networks Indicates the first Feature maps output by cascaded convolutional neural networks Indicates the first The feature map output by the self-attention network, when When =1, let = ; Input into the global module, and then... A series of cascaded self-attention networks Processing, and with A series of cascaded convolutional neural networks The obtained feature map By performing fusion, feature maps containing global information can be obtained using equations (6) to (9). = ; (6) (7) (8) (9) In equations (6) to (9), when When =1, let = ; Indicates after the first The query matrix obtained by a self-attention network; Indicates the use of calculation The weight matrix, Indicates after the first The key matrix obtained from a self-attention network Indicates the use of calculation The weight matrix, Showing the process of the first The value matrix obtained by a self-attention network Indicates the use of calculation The weight matrix, Indicates the first A multi-head self-attention mechanism in a self-attention network For the self-attention layer, It is an activation function. yes Dimensions This indicates the bulls' self-attention. Representation layer normalization, Indicates fusion, This represents the output weight matrix; Step 5: Construct an example aggregation network. Each fusion module and A multi-layer sensing mechanism is formed, and the result is obtained using equation (10). Predicted category labels : (10) In equation (10), This represents a multilayer perceptron. Indicates will Mapping to Same dimension; Step 5.1: Construct and train a CT image classification network consisting of a local-global Transformer and an example aggregation module; Step 5.2: Construct the first equation using equation (11). The overall loss function for multi-example contrastive learning of individual cases ; (11) Step 5.3: Based on a set of labeled lung CT slices According to the initial learning rate The CT image classification network was trained, and the overall loss function was calculated. To update network parameters when the number of training steps reaches Then, according to the learning rate Continue training the CT image classification network until the total number of training steps is reached, thereby obtaining a trained CT image classification network, which is used to classify lung CT images.

2. The CT image classification method based on multi-instance contrastive learning and Transformer technology according to claim 1, characterized in that, Step 2 includes: Step 2.1: Define the current iteration number as t, and initialize t=0; Step 2.2: Randomly select the t-th iteration. There are cluster centers, denoted as . ,in, Denotes the t-th iteration. Cluster centers; Step 2.3, using equation (1) to... Example of a lung Assigned to the category of the nearest center : (1) Step 2.4: Calculate the category in the (t+1)th iteration using equation (2). Cluster center : (2) In equation (2), Indicate category Cluster centers; Step 2.5: Construct the t-th equation using equation (3). loss function of the next iteration : (3) In equation (3), Indicates the t-th The sum of squared errors of the distances from the cluster centers of all lung examples in each iteration; Step 2.6, Judgment Whether it converges; if it converges, it means that all lung examples { | v =1,2,…, } divided into One category; otherwise, t +1 assignment t Then, return to steps 2.3-2.5 and execute them sequentially.

3. The CT image classification method based on multi-instance contrastive learning and Transformer technology according to claim 2, characterized in that, Step 3 includes: Step 3.1: Construct an example feature extractor, consisting of... Each convolutional layer Each Inception layer and It consists of several max-pooling layers; each Inception layer is composed of... The system consists of several convolutional layers; and the activation function of all convolutional layers is set to the ReLU function. Step 3.2, Input into the example feature extractor, and sequentially pass through... After processing by each convolutional layer, the convolutional feature vector is obtained. Then pass through in sequence Each Inception layer and After processing with a maximum pooling layer, the lung coding feature map is obtained. ; Step 3.3, from Randomly select the first category from the categories. i Example of a lung , will with Other examples belonging to the same category To construct positive example pairs, which will be with Belonging to different categories To construct negative example pairs, and thus use equation (4) to construct the first... i Example of a lung Contrast loss function ; (4) In equation (4), Indicates calculation and Cosine similarity; For temperature coefficient, It is an index function, if Then let If it is 1, then conversely, let it be 1. It is 0.

4. An electronic device, comprising a memory and a processor, characterized in that, The memory is used to store programs that support the processor in executing any of the CT image classification methods of claims 1-3, and the processor is configured to execute the programs stored in the memory.

5. A computer-readable storage medium storing a computer program thereon, characterized in that, The computer program, when run by the processor, performs the steps of any of the CT image classification methods described in claims 1-3.