A similarity retrieval method for lung CT images based on weakly supervised similarity evaluation network
Through the WSSENet network structure based on weak supervision, the spatial transformation layer and the deep learning model are used to calculate the outline and detail similarities, which solves the problem of similarity retrieval in lung CT image big data and achieves efficient similarity evaluation and label annotation. reduce.
Patent Information
- Application Number
- CN202210223640.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2024-09-06
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
It is difficult to achieve high-precision similarity retrieval in large lung CT image data, and the labeling work of deep learning networks is time-consuming and laborious. Especially in the medical field, the huge challenge of labeling needs to be solved.
Adopt a WSSENet network structure based on weak supervision, including a data set generator and a similarity calculator, train WSSENet through the LUNA16 data set, use spatial transformation layers and thin plate spline interpolation to generate network training sets, and combine Vision Transformer and resnet18 variants to calculate contours and detail similarity to achieve top-k retrieval of lung CT images.
It effectively solves the problem of data set labeling in network training, achieves accurate similarity assessment of lung CT images, reduces labeling costs, and improves retrieval efficiency.
Smart Images

Figure CN114627068B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of image retrieval methods and deep learning networks, and in particular relates to a lung CT image similarity retrieval method based on a weakly supervised similarity evaluation network. Background Art
[0002] With the rapid development of medical imaging technology and the advent of the big data era, high-resolution lung CT images, as one of the important types of medical images, have shown an explosive growth trend in number. How to find similar lung section images in these lung CT image big data has become a difficult problem.
[0003] Lung CT images are similar overall, and the differences between different images are all between pixels, that is, achieving a high-precision (pixel level) lung CT image similarity retrieval is the key problem that the present invention needs to solve. At the same time, similarity evaluation based on deep learning usually requires a large amount of data and labels, and such labels require medical experts to manually annotate images. As we all know, labeling is a time-consuming, laborious and expensive task, especially in the medical field. Labeling training for deep learning networks also brings huge challenges. Summary of the invention
[0004] The purpose of the present invention is to provide a lung CT image similarity retrieval method based on a weakly supervised similarity evaluation network to solve the above-mentioned technical problems.
[0005] To achieve the above purpose, the specific technical scheme of the lung CT image similarity retrieval method based on weakly supervised similarity evaluation network of the present invention is as follows:
[0006] A similarity retrieval method for lung CT images based on a weakly supervised similarity evaluation network includes a WSSENet network structure. The WSSENet includes a data set generator and a similarity calculator. The method includes the following steps:
[0007] Step 1: Train WSSENet based on the LUNA16 dataset;
[0008] Step 2: Based on WSSENet, realize top- k Retrieve.
[0009] Furthermore, the dataset generator includes a spatial transformation layer for generating an initial training set for network training, so that subsequent network training tends to be inexactly supervised, that is, the training samples have only coarse-grained labels; STL is responsible for providing a spatial transformation based on thin plate spline interpolation for each input.
[0010] Furthermore, the similarity calculator includes contour similarity calculation and detail similarity calculation. The task of the similarity calculator is to calculate the similarity S of the two lung CT images, where S includes S p and S d , S p It represents the contour similarity, that is, the similarity between the two images in terms of the shape of the lung parenchyma contour. It is a relatively low-precision similarity. d It indicates the detail similarity, which indicates the similarity between the two images in the shape and position of soft tissues such as capillaries and nodules inside the lung parenchyma. It is a relatively high-precision similarity.
[0011] The contour similarity calculator is composed of Vision Transformer, and the detail similarity calculator is composed of a variant of resnet18, wherein the variant of resnet18 replaces the fully connected layer with a convolutional layer that is more sensitive to position.
[0012] Further, the step 1 includes step 1.1:
[0013] First, the initial image M is preprocessed to extract the lung parenchyma part in the lung CT image to generate an image I, which is then input into STL to generate the data set and labels required for contour similarity calculator training, which is called training set S1;
[0014] The image is binarized by using different grayscale values corresponding to different CT values in the image, and then the seed filling algorithm is used to separate the external air and the internal trunk to obtain the lung mask. The lung is first inflated to fill the small cavities, and then corroded to restore the original size. Finally, the largest connected domain is retained. At this time, the largest connected domain is the lung, and the preprocessed image I1 is obtained;
[0015] Then use STL to generate the data set and labels required by the contour similarity calculator. I 1 (512*512*1), slightly deformed by STL to generate an image I 2 (512*512*1), then we can assume that I 1 and I 2 are similar, combine them into a 2*512*512 tensor and assign the label 1; find a set of images with dissimilar contours: I 1 Images with dissimilar contours can find cross-sectional images of different levels in the CT scan images of the same case, and combine them into a 2*512*512 tensor and assign it the label 0.
[0016] Furthermore, the step 1 includes step 1.2:
[0017] Build a Vision Transformer model as a contour similarity calculator, and use the training set S1 to train the contour similarity calculator so that the contour similarity calculator can calculate the similarity of the lung parenchyma contours of two lung CT images. The training set S1 and the training set S2 are collectively referred to as S. The specific training of the similarity calculator is as follows:
[0018] The sigmoid function g(x) is selected as the activation function, and the cross entropy function h(y) is used as the loss function of the contour similarity calculator and the detail similarity calculator, y=g(x); during training, the Adam optimizer is used to train the network, and the initial learning rate is 0.001. During the training process, if the loss function converges, the learning rate is adjusted to 0.0001 to continue learning until convergence.
[0019] Further, the step 1 includes step 1.3:
[0020] After the contour similarity calculator is trained, the contour similarity calculator is used to construct a data set and labels required for training the detail similarity calculator, which is called training set S2;
[0021] Using the contour similarity calculator to randomly search and input images in the database I 1 (512*512*1) images with contour similarity above a certain threshold I 2 (512*512*1), assuming that the two images are not similar in detail, then assign the label 0 to this group of images, that is, not similar, and synthesize them into a 2*512*512 tensor; Next, find images with similar details to give to the detail similarity calculator to learn, input image I 1 (512*512*1), then the lung CT images with adjacent layers in the same group of CT scan lung images must be similar in details, that is: in a group of CT scan lung images, if the input image I 1 is the lung section at layer r, and the image with similar details is the r -1 slice, or r +1 slice; then find a group of lung CT images with similar details, assign label 1, i.e. similar, and synthesize them into a 2*512*512 tensor.
[0022] Further, the step 1 includes step 1.4:
[0023] Build a ResNet18 variant model as a detail similarity calculator, and use the training set S2 to train the detail similarity calculator so that the detail similarity calculator can calculate the similarity of the shape and position of the soft tissue inside the lung parenchyma of the two lung CT images; the similarity calculator training process is the same as step 1.2.
[0024] Further, the step 2 includes step 2.1:
[0025] After the user inputs the image I1 to be retrieved, WSSENet is used to calculate the similarity between I1 and the images in the database that may be similar to it;
[0026] Each image in the database is obtained cyclically as the image to be retrieved and compared with the input image I1. Suppose the current image to be retrieved is I2. First, the grayscale histogram is compared to preliminarily screen whether I1 and I2 may be similar. The grayscale value statistical arrays of the two images are obtained respectively, with 10 grayscale values as a group, and the length of the grayscale value statistical array of the image is 26; compare the maximum values in the grayscale value statistical arrays of the two images. If the difference between the two is higher than 3000, the two images are not similar, and there is no need to input WSSENet, and filter directly; if the difference between the two is lower than 3000, the two images may be similar, and I1 and I2 are further input into WSSENet to output the similarity s.
[0027] Further, the step 2 includes step 2.2:
[0028] Sort the images to be retrieved that have similarity calculated with I1 using the big root heap structure, obtain the most similar k images and output them;
[0029] The similarity s and image I2 are stored in a big root heap and sorted according to the similarity s. According to the characteristics of the big root heap, images with high similarity are stored at the top of the heap. After traversing all images, k images from the top of the heap are output from the bottom.
[0030] The lung CT image similarity retrieval method based on a weakly supervised similarity evaluation network of the present invention has the following advantages: the WSSENet of the present invention is a weakly supervised similarity evaluation network model, which can effectively solve the data set labeling problem required in the network training process while achieving accurate evaluation of the similarity between two images. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flow chart of the WSSENet network model building and training process and top-k retrieval process of the present invention;
[0032] Figure 2 The overall architecture diagram of WSSENet of the present invention is shown;
[0033] Figure 3 It is the internal structure diagram of STL of the present invention;
[0034] Figure 4 The internal structure diagram of the Vision Transfomer of the present invention;
[0035] Figure 5 This is the internal structure diagram of the resnet18 variant of the present invention. DETAILED DESCRIPTION
[0036] In order to better understand the purpose, structure and function of the present invention, the following is a further detailed description of a lung CT image similarity retrieval method based on a weakly supervised similarity evaluation network of the present invention in conjunction with the accompanying drawings.
[0037] First, we introduce the WSSENet network structure. WSSENet has two major modules: dataset generator ( datasetgenerator ) and the similarity calculator ( SimilarityCalculator ).
[0038] The dataset generator contains a spatial transformation layer, which is mainly used to generate the initial training set for network training, so that the subsequent network training tends to be inexact supervision, that is, the training samples have only coarse-grained labels. STL is mainly responsible for providing a thin plate spline interpolation (STL) based on each input. Thin Plate Spline , TPS) spatial transformation.
[0039] The similarity calculator includes contour similarity calculation and detail similarity calculation, and is the core part of WSSENet for network training. The task of the similarity calculator is to calculate the similarity S of two lung CT images, where S includes S p and S d . S p It represents the contour similarity, that is, the similarity between the two images in terms of the shape of the lung parenchyma contour, which is a relatively low-precision similarity. d It represents detail similarity, which indicates the similarity between two images in terms of the shape and position of soft tissues such as capillaries and nodules inside the lung parenchyma. It is a relatively high-precision similarity.
[0040] The contour similarity calculator and detail similarity calculator are essentially two different deep learning networks. The contour similarity calculator is composed of Vision Transformer (ViT). The detail similarity calculator is composed of a variant of resnet18. Since the last fully connected layer of resnet18 has translation invariance, but we need a network that is more sensitive to position, we replace the fully connected layer with a convolutional layer that is more sensitive to position to form a variant of resnet18.
[0041] Based on the LUNA16 dataset, we can train WSSENet. The overall architecture of WSSENet is as follows: Figure 2 As shown, the specific steps of the method of the present invention are as follows Figure 1 As shown:
[0042] In step 1, the initial image M is first preprocessed to extract the lung parenchyma part in the lung CT image to generate image I, which is then input into STL to generate the data set and labels required for contour similarity calculator training, which is called training set S1.
[0043] According to the characteristics of CT images, CT images use grayscale values to reflect the degree of absorption of X-rays by organs or tissues, and use this to quantitatively evaluate the density of organ tissues in the image, which is called CT value, and the unit is HU (hounsfieldunit). The CT value of lung tissue in CT images is -500, but it is usually greater than this value. The image is binarized by using different grayscale values corresponding to different CT values in the image, and then the seed filling algorithm is used to separate the external air and the internal trunk to obtain the lung mask. Because there are many fibers inside the lungs, it looks like there will be cavities (relative to the lungs). To fill these cavities, the closing operation in morphology is used (expansion first, then corrosion). First, expand the lungs, fill the small cavities, and then corrode to restore the original size. Finally, retain the largest connected domain. At this time, the largest connected domain is the lungs, and the preprocessed image I1 is obtained.
[0044] Then use STL to generate the data set and labels required by the contour similarity calculator. The internal structure of STL is as follows: Figure 3 As shown, I 1 (512*512*1), slightly deformed by STL to generate an image I 2 (512*512*1), then we can assume that I 1 and I 2 are similar, they are combined into a 2*512*512 tensor and assigned the label 1. However, only the data set labeled as 1 cannot allow the contour similarity calculator to learn which images have dissimilar contours. Next, we need to find a group of images with dissimilar contours. Since a CT scan case consists of hundreds of slices, the contour shapes of different sections of the lungs will change dramatically with the obvious changes in the levels. I 1 Images with dissimilar contours can find cross-sectional images of different levels in the CT scan images of the same case, and combine them into a 2*512*512 tensor and assign it the label 0.
[0045] Step 2, such as Figure 4 As shown, a Vision Transformer model is built as a contour similarity calculator, and the contour similarity calculator is trained using training set S1 so that the contour similarity calculator can calculate the similarity of the lung parenchyma contours of two lung CT images. The specific training of the similarity calculator is as follows (training set S1 and training set S2 are collectively referred to as S):
[0046] The sigmoid function g(x) is selected as the activation function, and the cross entropy function h(y) is used as the loss function of the contour similarity calculator and the detail similarity calculator, y=g(x). During training, the Adam optimizer is used to train the network, and the initial learning rate is 0.001. During the training process, if the loss function converges, the learning rate is adjusted to 0.0001 to continue learning until convergence.
[0047] Step 3: After the contour similarity calculator is trained, the contour similarity calculator is used to construct the data set and labels required for training the detail similarity calculator, which is called the training set S2.
[0048] Using the contour similarity calculator to randomly search and input images in the database I 1 (512*512*1) images with contour similarity above a certain threshold I 2 (512*512*1). Assuming that the two images are not similar in detail, the label 0 (not similar) is assigned to this group of images and synthesized into a 2*512*512 tensor. Next, we need to find images with similar details to give to the detail similarity calculator for learning. Input image I 1 (512*512*1), then the lung CT images with adjacent layers in the same group of CT scan lung images must be similar in details, that is: in a group of CT scan lung images, if the input image I 1 is the lung section at layer r, and the image with similar details is the r -1 slice, or r +1 slice. Then we can find a group of lung CT images with similar details, assign them the label 1 (similar), and synthesize them into a 2*512*512 tensor.
[0049] Step 4: Figure 5 As shown, a resnet18 variant model is built as a detail similarity calculator, and the detail similarity calculator is trained using the training set S2, so that the detail similarity calculator can calculate the similarity of the shape and position of the soft tissue inside the lung parenchyma of two lung CT images.
[0050] The similarity calculator training process is the same as step 2.
[0051] Based on WSSENet, we can achieve top- k Retrieval system, the specific steps are as follows:
[0052] Step 1: After the user inputs the image I1 to be retrieved, WSSENet is used to calculate the similarity between I1 and the images in the database that may be similar to it.
[0053] Each image in the database is obtained in a loop as the image to be retrieved and compared with the input image I1. Assume that the currently obtained image to be retrieved is I2. First, the grayscale histogram is compared to preliminarily screen whether I1 and I2 may be similar. The grayscale value statistical arrays of the two images are obtained respectively, with 10 grayscale values as a group, and the length of the grayscale value statistical array of the image is 26. Compare the maximum values in the grayscale value statistical arrays of the two images. If the difference between the two is higher than 3000, the two images are not similar and do not need to be input into WSSENet, and are directly filtered. If the difference between the two is lower than 3000, the two images may be similar, and I1 and I2 are further input into WSSENet to output the similarity s.
[0054] Step 2: sort the images to be retrieved whose similarity is calculated with I1 using the big root heap structure, obtain the most similar k images and output them.
[0055] The similarity s and image I2 are stored in a big root heap and sorted according to the similarity s. According to the characteristics of the big root heap, images with high similarity are stored at the top of the heap. After traversing all images, k images from the top of the heap are output from the bottom.
[0056] It is to be understood that the present invention is described by some embodiments, and it is known to those skilled in the art that various changes or equivalent substitutions may be made to these features and embodiments without departing from the spirit and scope of the present invention. In addition, under the teachings of the present invention, these features and embodiments may be modified to adapt to specific circumstances and materials without departing from the spirit and scope of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed herein, and all embodiments falling within the scope of the claims of this application are within the scope of protection of the present invention.
Claims
1. A similarity retrieval method for lung CT images based on a weakly supervised similarity evaluation network, comprising a WSSENet network structure, wherein the WSSENet comprises a data set generator and a similarity calculator, characterized in that: The method comprises the following steps: Step 1: Train WSSENet based on the LUNA16 dataset; Step 1.1: First, the initial image M is preprocessed to extract the lung parenchyma part in the lung CT image to generate an image I, which is then input into STL to generate the data set and labels required for contour similarity calculator training, which is called training set S1; The image is binarized by using different grayscale values corresponding to different CT values in the image, and then the seed filling algorithm is used to separate the external air and the internal trunk to obtain the lung mask. The lung is first inflated to fill the small cavities, and then corroded to restore the original size. Finally, the largest connected domain is retained. At this time, the largest connected domain is the lung, and the preprocessed image I1 is obtained; Then use STL to generate the data set and labels required by the contour similarity calculator. I 1 (512*512*1), slightly deformed by STL to generate an image I 2 (512*512*1), then we can assume that I 1 and I 2 are similar, combine them into a 2*512*512 tensor and assign the label 1; find a set of images with dissimilar contours: I 1. Images with dissimilar contours can find cross-sectional images of different levels in the CT scan images of the same case, and combine them into a 2*512*512 tensor and assign it a label of 0; Step 1.2: Build a Vision Transformer model as a contour similarity calculator, and use the training set S1 to train the contour similarity calculator so that the contour similarity calculator can calculate the similarity of the lung parenchyma contours of two lung CT images. The training set S1 and the training set S2 are collectively referred to as S. The specific training of the similarity calculator is as follows: The sigmoid function g(x) is selected as the activation function, and the cross entropy function h(y) is used as the loss function of the contour similarity calculator and the detail similarity calculator, y=g(x); during training, the Adam optimizer is used to train the network, and the initial learning rate is 0.
001. During the training process, if the loss function converges, the learning rate is adjusted to 0.0001 to continue learning until convergence; Step 1.3: After the contour similarity calculator is trained, the contour similarity calculator is used to construct a data set and labels required for training the detail similarity calculator, which is called training set S2; Using the contour similarity calculator to randomly search and input images in the database I 1 (512*512*1) images with contour similarity above a certain threshold I 2 (512*512*1), assuming that the two images are not similar in detail, then assign the label 0 to this group of images, that is, not similar, and synthesize them into a 2*512*512 tensor; Next, find images with similar details to give to the detail similarity calculator to learn, input image I 1 (512*512*1), then the lung CT images with adjacent layers in the same group of CT scan lung images must be similar in details, that is: in a group of CT scan lung images, if the input image I 1 is the lung section at layer r, and the image with similar details is the r -1 slice, or r +1 slice; then find a group of lung CT images with similar details, assign label 1, i.e. similar, and synthesize them into a 2*512*512 tensor; Step 1.4: Build a ResNet18 variant model as a detail similarity calculator, and use the training set S2 to train the detail similarity calculator so that the detail similarity calculator can calculate the similarity of the shape and position of the soft tissue inside the lung parenchyma of the two lung CT images; the similarity calculator training process is the same as step 1.2; Step 2: Based on WSSENet, realize top- k Search; Step 2.1: After the user inputs the image I1 to be retrieved, WSSENet is used to calculate the similarity between I1 and the images in the database that may be similar to it; Each image in the database is obtained in a loop as the image to be retrieved and compared with the input image I1. Assume that the currently obtained image to be retrieved is I2. First, the grayscale histogram is compared to preliminarily screen whether I1 and I2 may be similar. The grayscale value statistical arrays of the two images are obtained respectively, with 10 grayscale values as a group, and the length of the grayscale value statistical array of the image is 26; compare the maximum values in the grayscale value statistical arrays of the two images. If the difference between the two is higher than 3000, the two images are not similar, and there is no need to input WSSENet, and filter directly; if the difference between the two is lower than 3000, the two images may be similar, and I1 and I2 are further input into WSSENet to output the similarity s; Step 2.2: Sort the images to be retrieved that have similarity calculated with I1 using the big root heap structure, obtain the most similar k images and output them; The similarity s and image I2 are stored in a big root heap and sorted according to the similarity s. According to the characteristics of the big root heap, images with high similarity are stored at the top of the heap. After traversing all images, k images from the top of the heap are output from the bottom.
2. The lung CT image similarity retrieval method based on weakly supervised similarity evaluation network according to claim 1 is characterized in that: The dataset generator includes a spatial transformation layer for generating an initial training set for network training, so that subsequent network training tends to be inexactly supervised, that is, the training samples have only coarse-grained labels; STL is responsible for providing a spatial transformation based on thin plate spline interpolation for each input.
3. The lung CT image similarity retrieval method based on weakly supervised similarity evaluation network according to claim 1, characterized in that: The similarity calculator includes contour similarity calculation and detail similarity calculation. The task of the similarity calculator is to calculate the similarity S of two lung CT images, where S includes S p and S d , S p It represents the contour similarity, that is, the similarity between the two images in terms of the shape of the lung parenchyma contour. It is a relatively low-precision similarity. d It indicates the detail similarity, which indicates the similarity between the two images in the shape and position of soft tissues such as capillaries and nodules inside the lung parenchyma. It is a relatively high-precision similarity. The contour similarity calculator is composed of Vision Transformer, and the detail similarity calculator is composed of a variant of resnet18, wherein the variant of resnet18 replaces the fully connected layer with a convolutional layer that is more sensitive to position.
