Cardiac ultrasound image recognition method based on GLNET and self-attention
By introducing GLNet and self-attention mechanism in cardiac ultrasound image recognition, the effectiveness problem of supervised learning model in data scarcity tasks is solved, and more efficient feature representation learning and semi-supervised training accuracy are improved.
Patent Information
- Application Number
- CN202311451252.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-03
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2043-11-03
AI Technical Summary
Existing supervised learning models have limited effectiveness in specific tasks where data and labels are scarce. In particular, SimCLR and MoCo have problems with optimization difficulties and slow update speeds in dictionary size and batch size, and unsupervised learning methods have problems in feature representation. Lack of diversity.
Adopting a cardiac ultrasound image recognition method based on GLNet and self-attention, by establishing a visual representation contrast learning framework, introducing Transformer to capture global dependencies, combining multiple GL layers and RepConv, using point-wise convolution and data-enhanced embedding, and freezing the projection head To improve representation stability and optimize the similarity of positive and negative samples through a contrastive learning framework.
It significantly improves the accuracy of semi-supervised training on cardiac ultrasound data sets, which is better than other unsupervised methods. It solves the problem of weak global representation of CNN and lack of local information of Transformer, and achieves more efficient feature representation learning.
Smart Images

Figure CN117437518B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical image processing, and in particular relates to a cardiac ultrasound image recognition method based on GLNet and self-attention. Background Art
[0002] Fully supervised network models are usually optimized for specific tasks, but for specific tasks where data and labels are scarce, the effectiveness of such supervised learning models is limited. SimCLR obtains two enhanced representations by randomly transforming the image and maximizes the similarity between the two representations to obtain a general model. However, the dictionary size and batch size of SimCLR are the same, lacking the diversity of different entities of the same object. In addition, batches that are too large are difficult to optimize and converge. MoCo still obtains their representations through different image enhancement strategies, using a queue-based dynamic dictionary to store more samples so that each batch can obtain more negative samples. At the same time, the momentum update encoder is combined to solve the problem of reduced consistency of key representations caused by rapid changes in the encoder, but the disadvantage is that the update speed is slow. Dwibedi proposed a method to sample the nearest neighbors from the data in the latent space and regard them as positive examples, providing more semantic changes for data enhancement. SimMM predicts the original signal by randomly masking some blocks, which are encoded and then regressed with a single-layer prediction head in the masked area. These unsupervised learning methods can obtain universal feature representations, which are convenient for application to downstream tasks. However, for specific tasks where data and labels are scarce, the effectiveness of such supervised learning models is limited. Summary of the invention
[0003] In view of this, the present invention proposes a cardiac ultrasound image recognition method based on GLNet and self-attention.
[0004] The cardiac ultrasound image recognition method based on GLNet and self-attention disclosed in the present invention comprises the following steps:
[0005] Establish a visual representation contrastive learning framework; the contrastive learning framework introduces Transformer on the basis of GLNet to help local blocks capture global dependencies, including multiple GL layers, each GL layer includes a GL block and 1 RepConv, the GL block includes multiple RepConv and 1 Transformer, and models the global and local information in the input features. Given an input tensor X∈R W×H×C , the local spatial information is encoded by n×n convolution, and then the feature dimension X1∈R is expanded using point-wise convolution W×H×d ;
[0006] During training, contrastive learning is performed by reducing the distance between positive samples;
[0007] After training, freeze the projection head and use only the encoder GLNet and representation to classify different echocardiograms;
[0008] When data augmentation on the same image cannot provide the following: different views of the same image, or variants of the same object, or one of the other similar entities in the same category, two data augmented embeddings (zi,zi+) are used as positive pairs, and negative samples come from other images in the same batch. z is the representation obtained after the encoder and projection head.
[0009] Furthermore, the image X is first transformed into X1 and X2 through different data augmentations, and then X1 and X2 are encoded into representations z1 and z2 using GLNet and the projection head, where the encoder and projection head of GLNet share parameters.
[0010] Furthermore, in order to model long-distance dependencies with an effective receptive field W×H and let the network learn a global representation with spatial inductive bias, X1 is expanded to N flattened patches X U ∈R P×N×d , where P = w × h, N = W × H is the number of tiles, h and w are the height and width of the tile respectively, W is, H is;
[0011] For each p∈{1,...,P}, the relationship between the tiles is encoded through Transformer to obtain X G ∈R P×N×d ,GL block captures local information within each tile and global information between different tiles;
[0012] Therefore, fold X G ∈R P×N×d To obtain X f ∈R W×H×d ;
[0013] Then use point-wise convolution to transform X f The channels are projected into a lower C-dimensional space and stacked with the input features X through a cascade operation;
[0014] Another n×n convolutional layer is used to fuse the stacked features; since X U Use convolution to encode local information in n×n area, X G Encode the global information of the tile, X G Each pixel in encodes all pixel information in X using the global receptive field; considering the number of channels that need to be matched, the network structure contains two branches, namely 3×3 convolution and residual mapping.
[0015] Furthermore, in order to ensure the stability of the output feature map, a 3×3 convolution with a weight of 1 is used for initialization; according to the convolution addition principle, the weights and biases of all branches are further superimposed to obtain a fused 3×3 convolution layer; the multi-branch structure of the convolution layer is merged into a single-branch structure using structural reparameterization. During the training phase, the network is a multi-branch structure, and the number of branches and layers in the network is reduced by merging the convolution layer and batch normalization layer in the residual block. The structure of the GL stage is as follows: Figure 4
[0016] (c).
[0017] Furthermore, the Transformer helps the local block capture global dependencies, specifically including: including multiple GL layers, each GL layer includes a GL block and 1 RepConv, the GL block includes multiple RepConv and 1 Transformer, modeling the global and local information in the input features, given an input tensor X∈R W×H×C , the local spatial information is encoded by n×n convolution, and then the feature dimension X1∈R is expanded using point-wise convolution W×H×d .
[0018] Furthermore, the following equation is used to make the similarity between samples z1 and z2 close, and to make the similarity between z1 and N-1 negative samples far away, guiding the training direction of the model:
[0019]
[0020] Among them, t represents the temperature coefficient, and the positive samples come from the query set, so the loss function is optimized as:
[0021]
[0022] in, Q + is a positive sample in the query set, Q - is a positive sample in the query set, Q is the query set, z i It is the feature obtained after the input image passes through the backbone network. is the closest image found to the current image.
[0023] The beneficial effects of the present invention are as follows:
[0024] The present invention designs a hybrid CNN-Transformer architecture GLNet, which solves the problem of weak global representation of CNN and lack of local information of Transformer through a diffusion mechanism from local to global to find representation. In order to intuitively analyze the effectiveness of the present invention, a cardiac ultrasound dataset is constructed. Compared with other unsupervised methods, the present invention achieves significant improvements, and the proposed model outperforms other state-of-the-art methods in semi-supervised training. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 Top-1 accuracy of cardiac ultrasound dataset, using representations learned from different unsupervised methods to train linear classifiers, with the cross representing supervised ResNet-50;
[0026] Figure 2 The query-based contrastive learning framework of the present invention;
[0027] Figure 3 Overview of the GLNet network;
[0028] Figure 4 The structure of the GL stage;
[0029] Figure 5 GLNet network design scheme;
[0030] Figure 6 Heat map visualization of the present invention on the cardiac ultrasound dataset, the first and third rows are the original image inputs during prediction, and the second and fourth rows are the corresponding drawn heat maps. DETAILED DESCRIPTION
[0031] The present invention is further described below in conjunction with the accompanying drawings, but the present invention is not limited in any way. Any changes or substitutions made based on the teachings of the present invention belong to the protection scope of the present invention.
[0032] In convolutional neural networks, high-level features depend on low-level features. It uses convolution kernels to continuously extract abstract high-level information from local parts. Transformer directly uses attention to capture global context information to establish long-distance dependencies and extract more powerful features, but Vision Transformer lacks features such as CNN translation invariance, which makes learning more difficult and requires larger datasets and stronger data enhancement to achieve better results. This paper combines the advantages of CNN in extracting underlying features with the advantages of ViT in modeling global high-level semantic information to realize the global-local network GLNet. Figure 2 Shows the network structure of GLNet.
[0033] Figure 3An overview of the global and local network (GLNet); in addition to RepConv, Transformer is introduced to help local blocks capture global dependencies. This paper designs the GL block (see Figure 3 ) is used to model the global and local information in the input features. Given an input tensor X∈R W×H×C , the local spatial information is encoded by n×n convolution, and then the feature dimension X1∈R is expanded using point-wise convolution W×H×d In order to model long-distance dependencies with an effective receptive field W×H and let the network learn a global representation with spatial inductive bias, X1 is expanded to N flattened tiles X U ∈R P×N×d , where P = w × h, N = W × H is the number of tiles, h and w are the height and width of the tile respectively. For each p∈{1,...,P}, the relationship between the tiles is encoded by Transformer to obtain X G ∈R P×N×d , the GL block captures local information within each tile and global information between different tiles. Therefore, we can fold X G ∈R P×N×d To obtain X f ∈R W×H×d . Then use point-by-point convolution to transform X f The channels are projected into a lower C-dimensional space and stacked with the input features X through a cascade operation. Another n×n convolutional layer is then used to fuse the stacked features. U Use convolution to encode local information in n×n area, X G Encode the global information of the tile, X G Each pixel in can encode all pixel information in X using the global receptive field. Considering the number of channels that need to be matched, the network structure should contain two branches, namely 3×3 convolution and residual mapping, such as Figure 4 (a). 1×1 convolution can be regarded as a special case of 3×3 convolution (expanded convolution with 0 padding of edge elements). The residual module in the network does not introduce additional computation, but it uses more memory than a single-branch structure. The residual structure makes deeper network models possible, but more branches reduce the efficiency of model training. To ensure the stability of the output feature map, a 3×3 convolution with a weight of 1 is used for initialization. According to the convolution addition principle, the weights and biases of all branches are further superimposed to obtain a fused 3×3 convolution layer. The present invention uses structural reparameterization to Figure 4The multi-branch structure of the convolutional layer in (b) is merged into a single-branch structure to achieve higher inference efficiency. During the training phase, the network is a multi-branch structure, and the number of branches and layers in the network is reduced by merging the convolutional layers and batch normalization layers in the residual block. The structure of the GL phase is shown in Figure 2. Figure 4 (c) Table 1 shows the three backbone networks GL(s,m,l) constructed for different scenarios.
[0034] The present invention uses the following equation to make the similarity between z1 and z2 close, and to make the similarity between z1 and N-1 negative samples far away, thereby guiding the training direction of the model:
[0035]
[0036] Wherein, t represents the temperature coefficient. The positive samples of the present invention come from the query set, so the loss function is optimized as follows:
[0037]
[0038] in, Q + is a positive sample in the query set, Q - is a positive sample in the query set, Q is the query set, z i It is the feature obtained after the input image passes through the backbone network. is the closest image found to the current image.
[0039] Next, a large-scale cardiac ultrasound dataset is constructed, and the architecture design proposed in the present invention is verified through ablation research.
[0040] The present invention has created a cardiac ultrasound dataset from different populations, including 23K images of 11 categories, namely aortic arch, aortic valve, main pulmonary artery, subxiphoid biventricular heart, subxiphoid four-chamber heart, left ventricular short axis, left ventricular long axis, apical two-chamber heart, apical three-chamber heart, apical four-chamber heart, and apical five-chamber heart. The image resolution is 800×600. Figure 6 A partial sample of the dataset is shown. Most of the research on unsupervised pre-training (learning unlabeled encoders) has been done on this dataset. To evaluate the learned representations, a linear classifier is trained on a fixed base network and the test accuracy is used as a metric to evaluate the quality.
[0041] Next, we present an ablation analysis of our method. After discussing the default settings, we first show the effect of different encoders when trained with a query set. Then, we introduce some design choices, such as the size of the query set and the variation of the batch size, and briefly discuss the number of parameters and computational overhead of our method.
[0042] Default settings. In the ablation experiments, our query set size is 4096 and the batch size is 512. We use the LARS optimizer with a cosine annealing scheme, warm-up for 10 epochs, a base learning rate of 0.3, and the default prediction head. All ablation experiments are performed under the linear evaluation setting on the cardiac ultrasound dataset.
[0043] Sample Collection Strategy. This paper is conducted in the context of contrastive unsupervised learning using similar samples in the query set as positive pairs. We also compare the results of methods using data-augmented images of the same sample as positive pairs (similar to SimCLR), and this analysis is shown in Table 2. Using the query set improves the Top-1 performance by 1.4%.
[0044] Different encoders. The proposed GLNet is compared with other networks as encoders. The results are shown in Table 1. Compared with the classic VGG-16, GLNet-m runs almost 5 times faster, with 10.9% higher accuracy and only 58% more parameters. The results show that GLNet is the best encoder choice for QueryCLR. Table 2 shows the effect of different strategies for obtaining positive samples.
[0045] Query set size. Results for query sets of different sizes are shown in Table 3. Larger query sets increase the chance of obtaining more similar samples from the entire dataset and have the best performance. Increasing the query set size above 4096 does not lead to significant performance improvements, probably due to the increase in the number of outdated embeddings in the query set.
[0046] Batch size. Batch size has been shown to be a key factor in performance, and the results for different batch sizes are shown in Table 4. In general, larger batch sizes are more representative of the dataset. At a peak of 512, larger batch sizes degrade model performance.
[0047] Table 1: Effect of using different networks and the proposed GLNet as encoder on the performance of the invention
[0048] Encoder parameter GFLOPs Top-1 VGG-16 138 15.62 67.7% ResNet-50 25.5 3.53 74.8% InceptionV3 24.0 5.21 75.3% Vision Transformer 22.1 23.10 74.3% GLNet-m 19.8 3.18 78.6%
[0049] Table 2: Effects of different strategies for obtaining positive samples
[0050]
[0051] Table 3. Effect of query set size on performance
[0052] Query set size 1024 2048 4096 8192 Top-1 77.8% 78.3% 78.6% 78.5% Top-5 87.6% 87.9% 88.3% 88.3%
[0053] Table 4 Evaluation of different batch size choices
[0054]
[0055]
[0056] The beneficial effects of the present invention are as follows:
[0057] The present invention designs a hybrid CNN-Transformer architecture GLNet, which solves the problem of weak global representation of CNN and lack of local information of Transformer through a diffusion mechanism from local to global to find representation. In order to intuitively analyze the effectiveness of the present invention, a cardiac ultrasound dataset is constructed. Compared with other unsupervised methods, the present invention achieves significant improvements, and the proposed model outperforms other state-of-the-art methods in semi-supervised training.
[0058] As used herein, the word "preferred" is intended to be used as an example, instance, or illustration. Any aspect or design described herein as "preferred" is not necessarily to be construed as being more advantageous than other aspects or designs. On the contrary, the use of the word "preferred" is intended to present concepts in a specific way. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusive "or". That is, unless otherwise specified or clear from the context, "X uses A or B" means any one of the naturally included permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0059] Moreover, although the present disclosure has been shown and described with respect to one or implementations, those skilled in the art will think of equivalent variations and modifications based on the reading and understanding of this specification and the accompanying drawings. The present disclosure includes all such modifications and variations, and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the above-mentioned components (such as elements, etc.), the terms used to describe such components are intended to correspond to any component (unless otherwise indicated) that performs the specified function of the component (such as it is functionally equivalent), even if the structure is not equivalent to the disclosed structure of the function in the exemplary implementation of the present disclosure shown herein. In addition, although the specific features of the present disclosure have been disclosed with respect to only one of several implementations, such features can be combined with one or other features of other implementations that may be desired and advantageous for a given or specific application. Moreover, insofar as the terms "including", "having", "containing" or their variations are used in specific embodiments or claims, such terms are intended to be included in a manner similar to the term "comprising".
[0060] The functional units in the embodiments of the present invention may be integrated into a processing module, or each unit may exist physically separately, or multiple or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc. The above-mentioned devices or systems may execute the storage method in the corresponding method embodiment.
[0061] To sum up, the above embodiment is an implementation mode of the present invention, but the implementation mode of the present invention is not limited by the embodiment. Any other changes, modifications, substitutions, combinations, and simplifications that deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A cardiac ultrasound image recognition method based on GLNet and self-attention, characterized in that: The following steps are involved: Establish a visual representation contrastive learning framework; the contrastive learning framework introduces Transformer on the basis of GLNet to help local blocks capture global dependencies, including multiple GL layers, each GL layer includes a GL block and 1 RepConv, the GL block includes multiple RepConv and 1 Transformer, and models the global and local information in the input features. Given an input tensor X∈R W×H×C , the local spatial information is encoded by n×n convolution, and then the feature dimension X1∈R is expanded using point-wise convolution W×H×d ; During training, contrastive learning is performed by reducing the distance between positive samples; After training, freeze the projection head and use only the encoder GLNet and representation to classify different echocardiograms; Using two data augmented embeddings when data augmentation on the same image does not provide different views of the same image, or variants of the same object, or one of the other similar entities in the same category As positive pairs, negative samples come from other images in the same batch, and z is the representation obtained after the encoder and projection head; The image X is first converted to X1 and X2 through different data augmentations, and then X1 and X2 are encoded into representations z1 and z2 using GLNet and the projection head. The encoder and projection head of GLNet share parameters. In order to model long-distance dependencies with an effective receptive field W×H and let the network learn a global representation with spatial inductive bias, X1 is expanded into N flattened patches X U ∈R P×N×d , where P = w × h, N = W × H is the number of tiles, h and w are the height and width of the tile respectively; For each p∈{1,…,P}, the relationship between the tiles is encoded through Transformer to obtain X G ∈R P×N×d ,GL block captures local information within each tile and global information between different tiles; Therefore, fold X G ∈R P×N×d To obtain X f ∈R W×H×d ; Then use point-wise convolution to transform X f The channels are projected into a lower C-dimensional space and stacked with the input features X through a cascade operation; Another n×n convolutional layer is used to fuse the stacked features; since X U Use convolution to encode local information in n×n area, X G Encode the global information of the tile, X G Each pixel in encodes all pixel information in X using the global receptive field; Considering the number of channels that need to be matched, the network structure contains two branches, namely 3×3 convolution and residual mapping; The following equation is used to make the similarity between samples z1 and z2 close, and to make the similarity between z1 and N-1 negative samples far away, guiding the training direction of the model: Among them, t represents the temperature coefficient, and the positive samples come from the query set, so the loss function is optimized as: in, Q + is a positive sample in the query set, Q - is the negative sample in the query set, Q is the query set, z i It is the feature obtained after the input image passes through the backbone network. The goal is to find the image that is closest to the current image.
2. The cardiac ultrasound image recognition method based on GLNet and self-attention according to claim 1, characterized in that: To ensure the stability of the output feature map, a 3×3 convolution with a weight of 1 is used for initialization; according to the convolution addition principle, the weights and biases of all branches are further superimposed to obtain a fused 3×3 convolution layer; the multi-branch structure of the convolution layer is merged into a single-branch structure using structural reparameterization; During the training phase, the network is a multi-branch structure, which reduces the number of branches and layers in the network by merging convolutional layers and batch normalization layers in residual blocks.
Citation Information
Patent Citations
Self-distillation contrast learning method for remote sensing image scene classification
CN115019123A
Unsupervised echocardiogram section identification method
CN115578589A
Light-weight pest recognition method based on Transform structure
CN115965819A
Video action recognition method based on local and global attention mechanisms
CN116129326A
Self-supervised facial expression recognition method combining comparative learning with mask image modeling
CN116386104A
