Bone CT image segmentation method and device, computer equipment and storage medium
By using the pre-training model and the mutual information loss function to update parameters in bone CT image segmentation, the problems of low segmentation accuracy and high training difficulty in bone CT image segmentation methods are solved, and the generalization and segmentation accuracy of the model are improved.
Patent Information
- Application Number
- CN202410723095.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-05
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2044-06-05
Smart Images

Figure CN118735930A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a bone CT image segmentation method, device, computer equipment and storage medium. Background Art
[0002] Orthopedic diseases refer to a series of diseases that affect the human skeletal system, including fractures, osteoporosis, arthritis, bone tumors, etc., and the possibility of orthopedic diseases in the human skeletal system will increase with age. Medical imaging plays a vital role in the diagnosis and treatment of orthopedic diseases. Computed tomography (CT) imaging technology is an important tool commonly used in the diagnosis of orthopedic diseases. Clinically, CT imaging technology is widely used in the treatment of various orthopedic diseases, such as fracture diagnosis, evaluation and bone tumor diagnosis. This imaging method can provide high-resolution, three-dimensional bone and tissue structure images, which can help doctors accurately locate the lesion site, evaluate the extent and severity of the lesion, and provide patients with more accurate diagnosis and treatment plans. Nowadays, all orthopedic disease diagnosis and treatment plans are heavily dependent on the successful positioning of bones in CT images. In CT imaging technology, bone segmentation of bone CT images is an important processing step. However, traditional bone segmentation is performed manually or semi-automatically, which is inefficient and extremely tedious, and is not practical in clinical practice. Therefore, high-quality and fast automatic bone segmentation in bone CT images is crucial for the analysis of orthopedic diseases and the formulation of treatment plans.
[0003] In recent years, due to the rapid development of deep learning technology, medical image segmentation methods based on deep learning have become popular. The segmentation method based on deep learning can enable the network to learn the deep features of the image, and no longer rely solely on the strength of the bones in the image. This method has achieved good results and has surpassed the traditional segmentation method to a certain extent in terms of speed and accuracy. However, the existing segmentation methods based on deep learning still generally have some defects. For example, one method uses the graph cut segmentation method. After a given starting point, the bone image boundary is enhanced by a spatial enhancement filter, and then the traditional graph cut segmentation method is performed to improve the segmentation accuracy. The defects of this method are: high image quality requirements and slow image processing speed; another method uses a cascade method to cascade the image segmentation network at multiple scales, calculates and confirms the cascade method and depth according to the image, uses the corresponding segmentation training method, combines the two-dimensional and three-dimensional segmentation methods, and segments the three-dimensional image in the form of slices and the whole. The defects of this method are: the network is large and complex in structure and the overall interpretability is poor, the training time is long and it occupies a lot of resources. Another method integrates distance weighting into the training of the image segmentation network. First, the target bone is separated from the overall image, and then the edge weight image is obtained by the voxel calculation method. The image is used to deepen the model's attention to the edge, so as to achieve the effect of fine segmentation of the fracture edge. The defects of this method are: the edge weight needs to be calculated before segmentation, the mask accuracy is high, and the trained model has poor generalization, and can only have high segmentation accuracy for bones in a certain part.
[0004] Therefore, how to provide a bone CT image segmentation method that can ensure segmentation accuracy, lower training difficulty and higher generalization is a problem to be solved by those skilled in the art. Summary of the invention
[0005] The embodiments of the present invention provide a bone CT image segmentation method, apparatus, computer equipment and storage medium, aiming to reduce the training difficulty of bone CT image segmentation and improve the generalization of bone CT image segmentation while ensuring the segmentation quality, thereby improving the accuracy and stability of model segmentation prediction.
[0006] In a first aspect, an embodiment of the present invention provides a bone CT image segmentation method, comprising:
[0007] Obtain bone CT training images and their true masks;
[0008] Inputting the real mask of the bone CT training image into an encoder for feature extraction to obtain a first feature map, decoding the first feature map through a decoder to obtain a corresponding generated mask, and then using a discriminator to discriminate the real mask and the generated mask respectively;
[0009] Constructing a first loss function based on the discrimination result of the discriminator, and updating the parameters of the encoder, decoder and discriminator by using the first loss function to construct a pre-trained model;
[0010] Inputting the bone CT training image into the pre-training model, extracting the second feature map from the bone CT training image through the encoder in the pre-training model, and then generating a training image segmentation result for the second feature map through the decoder in the pre-training model, thereby constructing an initial segmentation model;
[0011] Calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, and updating the parameters of the initial segmentation model by using the second loss function to construct a bone CT image segmentation model;
[0012] The bone CT image segmentation model is used to perform image segmentation processing on the designated bone CT image.
[0013] In a second aspect, an embodiment of the present invention provides a bone CT image segmentation device, comprising:
[0014] An image acquisition unit, used for acquiring a bone CT training image and its true mask;
[0015] A mask processing unit, configured to input the real mask of the bone CT training image into an encoder for feature extraction to obtain a first feature map, decode the first feature map through a decoder to obtain a corresponding generated mask, and then use a discriminator to discriminate the real mask and the generated mask respectively;
[0016] A first parameter updating unit, configured to construct a first loss function based on a discrimination result of the discriminator, and to update parameters of the encoder, the decoder and the discriminator by using the first loss function, so as to construct a pre-trained model;
[0017] A segmentation training unit, used for inputting the bone CT training image into the pre-training model, extracting the second feature map from the bone CT training image through the encoder in the pre-training model, and then generating a training image segmentation result for the second feature map through the decoder in the pre-training model, so as to construct an initial segmentation model;
[0018] A second parameter updating unit, used for calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, and performing parameter updating on the initial segmentation model by using the second loss function to construct a bone CT image segmentation model;
[0019] The designated image segmentation unit is used to perform image segmentation processing on the designated bone CT image by using the bone CT image segmentation model.
[0020] In a third aspect, an embodiment of the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the bone CT image segmentation method as described in the first aspect when executing the computer program.
[0021] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the bone CT image segmentation method as described in the first aspect is implemented.
[0022] The embodiment of the present invention discloses a bone CT image segmentation method, device, computer equipment and storage medium. The method uses the real mask of the bone CT training image as input for training in the pre-training stage to obtain a first feature map, and obtains a pre-training model with the ability to extract target shape features. Then, in the segmentation training stage, the bone CT training image is directly used as input for training to obtain a second feature map. Then, the mutual information between the first feature map and the second feature map is calculated, and a loss function is constructed based on the mutual information to update the model parameters to obtain a bone CT image segmentation model. In this way, the features extracted by the bone CT image segmentation model and the features extracted by the pre-training model can be kept away from each other, so that the bone CT image segmentation model reduces the focus on the target shape features and learns more high-dimensional features. In this way, the generalization of the bone CT image segmentation model can be improved while ensuring the segmentation accuracy and reducing the difficulty of model training, thereby improving the accuracy and stability of the model segmentation prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0024] Figure 1 A schematic diagram of a flow chart of a bone CT image segmentation method provided by an embodiment of the present invention;
[0025] Figure 2 A schematic diagram of the principle of a bone CT image segmentation method provided by an embodiment of the present invention;
[0026] Figure 3 A schematic diagram of a sub-process of a bone CT image segmentation method provided by an embodiment of the present invention;
[0027] Figure 4 A schematic block diagram of a bone CT image segmentation device provided by an embodiment of the present invention;
[0028] Figure 5 A sub-schematic block diagram of a bone CT image segmentation device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] It should be understood that when used in this specification and the appended claims, the terms "include" and "comprises" indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.
[0031] It should also be understood that the terms used in this specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the specification of the present invention and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0032] It should be further understood that the term "and / or" used in the present description and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0033] See below Figure 1 , Figure 1 A schematic flow chart of a bone CT image segmentation method provided by an embodiment of the present invention specifically includes: steps S101 to S106.
[0034] S101, obtaining a bone CT training image and its true mask;
[0035] S102, inputting the real mask of the bone CT training image into an encoder for feature extraction to obtain a first feature map, decoding the first feature map through a decoder to obtain a corresponding generated mask, and then using a discriminator to discriminate the real mask and the generated mask respectively;
[0036] S103, constructing a first loss function based on the discrimination result of the discriminator, and updating the parameters of the encoder, decoder and discriminator by using the first loss function to construct a pre-trained model;
[0037] S104, inputting the bone CT training image into the pre-training model, extracting the bone CT training image through the encoder in the pre-training model to obtain a second feature map, and then generating a training image segmentation result for the second feature map through the decoder in the pre-training model, thereby constructing an initial segmentation model;
[0038] S105, calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, and updating the parameters of the initial segmentation model by using the second loss function to construct a bone CT image segmentation model;
[0039] S106: Perform image segmentation processing on the designated bone CT image using the bone CT image segmentation model.
[0040] Combination Figure 2 As shown, in this embodiment, the training steps of the bone CT image segmentation model are divided into two stages: pre-training and segmentation training. In the pre-training stage, it is first necessary to obtain a bone CT training image for training, and obtain a real mask corresponding to the bone CT training image. Secondly, the real mask is input into the encoder for feature extraction, and then the first feature map obtained by the feature extraction is decoded by the decoder to obtain the corresponding generated mask. Then, the real mask and the generated mask are input into the discriminator for discrimination, and a first loss function for updating parameters is constructed according to the discrimination result. Finally, the parameters of the encoder, decoder and discriminator are updated by the first loss function, so as to construct a pre-trained model. After that, the segmentation training stage begins. In the segmentation training stage, the bone CT training image is first input into the pre-training model constructed in the pre-training stage, and the encoder in the pre-training model is used to extract features to obtain the second feature map of the bone CT training image. Secondly, the decoder in the pre-training model performs segmentation prediction on the second feature map output by the encoder, and generates a training image segmentation result to construct an initial segmentation model. Then, the first feature map and the second feature map are combined to calculate the mutual information. Then, the second function is constructed according to the calculated mutual information. Finally, the parameters of the initial segmentation model are updated through the second function, thereby obtaining a bone CT image segmentation model.
[0041] In the pre-training stage, the present embodiment uses the real mask of the bone CT training image as input for training to obtain the first feature map, and obtains a pre-training model with the ability to extract target shape features. Then, in the segmentation training stage, the bone CT training image is directly used as input for training to obtain the second feature map. Then, the mutual information between the first feature map and the second feature map is calculated, and the loss function is constructed based on the mutual information to update the model parameters to obtain the bone CT image segmentation model. In this way, the features extracted by the bone CT image segmentation model and the features extracted by the pre-training model can be separated, so that the bone CT image segmentation model reduces the focus on the target shape features and learns more high-dimensional features. In this way, the generalization of the bone CT image segmentation model can be improved while ensuring the segmentation accuracy and reducing the difficulty of model training, thereby improving the accuracy and stability of the model segmentation prediction. In particular, the present embodiment can be trained with only a single type of bone CT training image, and there is no need to fine-tune the input image, so that the model can obtain good segmentation results for bone CT images of different parts. Among them, mutual information represents the correlation between two sets of features. For example, when the mutual information decreases, it means that the correlation between the two sets of features decreases, that is, the two sets of features are moving away from each other. Using the decrease in correlation as a metric for model training can achieve the effect of increasing the generalization of the model.
[0042] It should also be noted that after the bone CT image segmentation model is trained, when the bone CT image segmentation model is used to perform image segmentation processing on the specified bone CT image, the processing steps of the bone CT image segmentation model are as follows: Figure 2 As shown in the segmentation training stage, the specified bone CT image is first input into the encoder for feature extraction, the corresponding feature map is extracted, and then the feature map is input into the decoder for image segmentation, thereby obtaining the image segmentation result.
[0043] In a specific application scenario, the true mask of the bone CT training image can be obtained by directly acquiring existing data, or can also be drawn by a professional doctor based on information such as the type, quantity and distribution of bones in the bone CT training image. In addition, before the model training process is performed in this embodiment, it is also necessary to set hyperparameters, and iteratively train all training data (bone CT training images and their true masks) according to the hyperparameters. For example, a stochastic gradient descent optimization algorithm can be used to iteratively train all training data five hundred times, and the initial learning rate is set to 0.0001, the learning rate adjustment strategy is 0.01*(1-(epoch / 100)^0.9), and the batch processing capacity is set to 5, and the model weights are saved after the 50th generation of training.
[0044] In addition, in other embodiments, the present embodiment may also use other types of medical images as training images, and obtain corresponding prediction models through training through the steps described above, thereby using the trained segmentation prediction model to perform segmentation prediction on the medical images of this type.
[0045] In one embodiment, the step S101 includes:
[0046] After acquiring the bone CT training image, resampling the bone CT training image according to a preset sampling interval to adjust the image size of the bone CT training image;
[0047] The resampled bone CT training image is subjected to image standardization processing.
[0048] In this embodiment, the bone CT training image is first resampled according to a preset sampling interval, so as to adjust the image size of the bone CT training image so that its image size meets the input requirement of model training. After the size is adjusted, the bone CT training image needs to be normalized. The purpose of image normalization is to make its image data conform to the data distribution law, for example, to make the distribution mean of the bone CT training image 0 and the variance 1.
[0049] In actual application scenarios, SimpleITK software (a software specialized in processing medical images) can be used to perform image resampling and image standardization. After training the bone CT image segmentation model, when it is necessary to perform image segmentation on a specified bone CT image, the specified bone CT image can be resampled and standardized first, and then the weight of the bone CT image segmentation model can be read, and the specified bone CT image can be divided into multiple image blocks. The segmentation result can be reconstructed through unit sliding window reasoning, which can significantly improve the efficiency and accuracy of the model.
[0050] Combination Figure 3 As shown, in one embodiment, step S102 includes: steps S301 to S304.
[0051] S301, downsampling the real mask by the encoder to extract the first feature map;
[0052] Specifically, step S301 includes:
[0053] The true mask is input into a plurality of visual converters arranged in succession, and the output result of the last visual converter is used as the first feature map; wherein each visual converter includes a vector embedding layer, an attention layer, a multi-layer perceptron and a normalization layer in sequence.
[0054] The encoder in this step is continuously provided with multiple visual transformers (VIT, Vision Transformer). The real mask is sequentially input into the multiple visual transformers continuously provided in the encoder, and the real mask is sequentially processed by the vector embedding layer, attention layer, multi-layer perceptron and normalization layer in each visual transformer. When the last visual transformer is processed and the output result is obtained, it is used as the first feature map for subsequent processing. Among them, after the real mask passes through the vector embedding layer in the visual transformer, its size will become 1 / 16 before the input vector embedding layer, and its channel will also become the size set by the hyperparameter. In addition, the size of the output image of each visual transformer is equal to the size of the image input. In actual application scenarios, the number of visual transformers in the encoder depends on the specific encoder design and application requirements. Specifically, the appropriate number of visual transformers can be selected according to the complexity of the task and the limitation of computing resources. For example, 12 visual transformers can be continuously provided in the encoder.
[0055] S302, obtaining the number of target bone types contained in the bone CT training image according to the true mask, and initializing the latent space coding according to the number of target bone types to obtain an initial latent space coding;
[0056] This step initializes the latent space encoding according to the number of target bone types, which can enable the model to adapt and learn the characteristics and patterns of bones in bone CT training images more quickly during the training process, thereby improving the accuracy of subsequent segmentation predictions.
[0057] S303, jump-connecting the first feature map and the initial latent space code and inputting them into the decoder for decoding and projection, so as to obtain a generation mask of the bone CT training image;
[0058] Specifically, step S303 includes:
[0059] Performing a first skip connection between the first feature map and the initial latent space encoding, and inputting the result of the first skip connection into the decoder having multiple convolutional layers;
[0060] Using the first convolution layer of the decoder to perform a first convolution process on the result of the first skip connection, and outputting the result of the first convolution process;
[0061] Performing a second jump connection on the result of the first convolution process and the initial latent space code, and inputting the result of the second jump connection into the second convolution layer for a second convolution process, and then outputting the result of the second convolution process by the second convolution layer;
[0062] Inputting the result of the second convolution processing to the third convolution layer for the third convolution processing, and the third convolution layer outputs the result of the third convolution processing;
[0063] The result of the third convolution processing is input to the next convolution layer to continue the convolution processing, and the next convolution layer outputs the corresponding convolution processing result, and so on, until the last convolution layer outputs the last convolution processing result, and the last convolution processing result is used as the generated mask.
[0064] In this step, the first feature map is firstly subjected to a first jump connection process with the initial latent space code, and then the result of the first jump connection is input into the decoder, which has a plurality of convolutional layers arranged in sequence, and the result of the first jump connection is subjected to a second jump connection and multiple convolution processes in the decoder, and finally a generated mask is obtained. This embodiment can strengthen the control of the initial latent space code over the decoder by jump-connecting the feature map with the initial latent space code, prevent the information of the initial latent space code from being lost in long-distance operations, and enable the feature information of the low level to be directly transmitted to the high level, which helps to retain more spatial information and details, thereby generating a more accurate generated mask.
[0065] Among them, the result of the first jump connection is first processed by the first convolution layer for the first convolution, and the result of the first convolution is output. Then the result of the first convolution will be processed again with the initial latent space code for the second jump connection. The result of the second jump connection is then processed by the second convolution layer for the second convolution. The result of the second convolution is directly processed by the third convolution layer for the third convolution, and so on until the last convolution layer outputs the last convolution result, which is then used as the generated mask output.
[0066] In a specific embodiment, the multi-layer convolution layer of the decoder is a plurality of decoding modules, each of which includes convolution, activation function and normalization operation, wherein the feature map will first undergo transposed convolution before passing through the decoding module, and its size will be doubled by upsampling, and the shallow feature map of the corresponding size will be spliced with it using a jump connection, and then input into the decoding module for processing, wherein the number of decoding modules here can be adjusted according to the actual situation, such as setting four decoding modules, etc. In addition, in addition to the one jump connection before the feature map is input into the decoder, the number of jump connections in the decoder can also be adjusted according to different actual situations, for example, a larger number of jump connections can be set to generate a more accurate generation mask, or a smaller number of jump connections can be set to avoid destroying the feature map information, etc.
[0067] S304: Input the real mask and the generated mask into the discriminator for discrimination, and output a discrimination result including a real value and a false value through an output function in the discriminator.
[0068] In this step, the discriminator for distinguishing the real mask and the generated mask is composed of four visual converters, three downsampling modules and an output module. The downsampling module includes convolution, activation function and normalization operation. The number of channels of the real mask and the generated mask input to the downsampling module will become twice as much as the original, and the image size will become 1 / 3 of the original; the output module includes a linear layer and a normalization layer. The output module will scale the input features to pseudo values or real values, which are used to represent the discriminator to judge whether the input features are real masks. Specifically, if the discrimination result is a pseudo value, it means that the corresponding input feature is not a real mask, and if the discrimination result is a real value, it means that the corresponding input feature is a real mask.
[0069] In this embodiment, the true mask is first used as the input of the encoder, and the encoder performs downsampling processing on it to extract the first feature map, then the number of target bone types contained in the corresponding bone CT training image is obtained based on the true mask, and the latent space encoding is initialized according to the number of target bone types to obtain the initial latent space encoding, then the first feature map and the initial latent space encoding are jump-connected, and the first feature map and the initial latent space encoding after the jump connection are input to the decoder, and the decoder decodes and projects them, that is, the first feature map and the initial latent space encoding are projected back to the image space to generate a generated mask of the bone CT training image, and finally the true mask and the generated mask are input to the discriminator for discrimination, and the output function in the discriminator outputs the corresponding discrimination result, which contains the true value ( Figure 2 "1" in the middle) and a pseudo value ( Figure 2 in the middle).
[0070] In one embodiment, the step S103 includes:
[0071] Reverse reasoning the generated mask to obtain a reverse latent space encoding;
[0072] Calculate the entropy of the true mask and the true value in the discrimination result to obtain a first cross entropy loss function; calculate the entropy of the generated mask and the pseudo value in the discrimination result to obtain a second cross entropy loss function; calculate the entropy of the reverse latent space encoding and the true mask to obtain a third cross entropy loss function;
[0073] According to the following formula, the first cross entropy loss function, the second cross entropy loss function and the third cross entropy loss function are summed to obtain the first loss function:
[0074]
[0075] in, represents the first loss function, represents the first cross entropy loss function, D represents the decoder, G represents the discriminator, f' represents the first feature map, c represents the initial latent space encoding, 0 represents the pseudo value, represents the second cross entropy loss function, y represents the true mask, 1 represents the true value, represents the third cross entropy loss function, and c' represents the reverse latent space encoding.
[0076] In this embodiment, the generated mask is firstly reversely inferred to obtain the corresponding reverse latent space encoding, and then multiple cross entropy loss functions are calculated by combining the reverse latent space encoding, the real mask, the generated mask and the discrimination result, and the calculated cross entropy loss functions are summed to obtain the first loss function for updating the model parameters. Among them, by calculating the entropy of the real mask and the real value in the discrimination result to obtain the first cross entropy loss function, and calculating the entropy of the generated mask and the pseudo value in the discrimination result to obtain the second cross entropy loss function, the ability of the discriminator to distinguish the real mask from the generated mask can be improved, so as to prompt the decoder to generate a more accurate mask and the discriminator to compete with each other, so that the model can learn more features; by calculating the entropy of the reverse latent space encoding and the real mask to obtain the third cross entropy loss function, the relevant features learned by the model can be concentrated on the appearance features, and finally the model can generate more accurate segmentation results.
[0077] This embodiment can obtain the reverse latent space coding through reverse reasoning, so that the skeletal features of the training image are strongly associated with the latent space coding, and at the same time make the discriminator and the decoder compete, urging the decoder to generate an image closer to the real mask, thereby improving accuracy and achieving Nash equilibrium.
[0078] In a specific application scenario, the output module of the discriminator has two output heads, one output head is used to calculate and output the first cross entropy loss function and the second cross entropy loss function, and the other output head is used to calculate and output the third cross entropy loss function.
[0079] In some other application scenarios, the model parameters can also be updated by calculating the mutual information in the pre-training stage and using the mutual information in this stage instead of the cross entropy loss function.
[0080] In one embodiment, the step S105 includes:
[0081] The mutual information between the first feature map and the second feature map is calculated according to the following formula:
[0082]
[0083] Among them, Isg represents the mutual information, I represents the mutual information operator, H(f) represents the entropy of the second feature map, H(f') represents the entropy of the first feature map, H(f,f') represents the entropy of the joint distribution of the first feature map and the second feature map, P represents the joint probability distribution, and log represents the logarithmic function;
[0084] The second loss function is constructed by combining the mutual information and the Dice loss function:
[0085]
[0086] in, represents the second loss function, and DiceLoss represents the Dice loss function.
[0087] In this embodiment, the mutual information is obtained by calculating the entropy of each item. Entropy is an indicator to measure the uncertainty of the feature. Mutual information measures the correlation between the two groups of features by comparing the entropy of the two groups of features. Mutual information represents the correlation between the two groups of features. Since the direction of updating the model parameters is to expect the mutual information to decrease during the calculation process, the mutual information can be used as part of the loss function to update the model parameters. Using the decrease in correlation as a metric for model training can achieve the effect of increasing the generalization of the model. In addition, this embodiment also uses the Dice loss function of the model as part of the second loss function, and adds it to the mutual information to obtain the second loss function. The Dice loss function is a commonly used loss function, which is used to measure the similarity between the segmentation result generated by the model and the real segmentation label. In addition, the mutual information in this embodiment can be calculated using a continuous calculation method or a discrete calculation method.
[0088] Figure 4 A schematic block diagram of a bone CT image segmentation device 400 provided in an embodiment of the present invention, the device 400 includes:
[0089] An image acquisition unit 401 is used to acquire a bone CT training image and its true mask;
[0090] The mask processing unit 402 is used to input the real mask of the bone CT training image into the encoder for feature extraction to obtain a first feature map, and decode the first feature map through the decoder to obtain a corresponding generated mask, and then use a discriminator to distinguish the real mask and the generated mask respectively;
[0091] A first parameter updating unit 403 is used to construct a first loss function based on the discrimination result of the discriminator, and update the parameters of the encoder, decoder and discriminator through the first loss function to construct a pre-trained model;
[0092] The segmentation training unit 404 is used to input the bone CT training image into the pre-training model, extract the second feature map from the bone CT training image through the encoder in the pre-training model, and then generate a training image segmentation result for the second feature map through the decoder in the pre-training model, so as to construct an initial segmentation model;
[0093] A second parameter updating unit 405 is used to calculate the mutual information between the first feature map and the second feature map, and construct a second loss function based on the mutual information, and update the parameters of the initial segmentation model by using the second loss function to construct a bone CT image segmentation model;
[0094] The designated image segmentation unit 406 is used to perform image segmentation processing on the designated bone CT image by using the bone CT image segmentation model.
[0095] In one embodiment, the image acquisition unit 401 includes:
[0096] a resampling unit, configured to resample the bone CT training image according to a preset sampling interval after acquiring the bone CT training image, so as to adjust the image size of the bone CT training image;
[0097] The standardization processing unit is used to perform image standardization processing on the resampled bone CT training image.
[0098] Combination Figure 5 As shown, in one embodiment, the mask processing unit 402 includes:
[0099] A downsampling processing unit 501 is used to perform downsampling processing on the real mask through the encoder to extract the first feature map;
[0100] A code acquisition unit 502 is used to acquire the number of target bone types contained in the bone CT training image according to the true mask, and initialize the latent space code according to the number of target bone types to obtain an initial latent space code;
[0101] A decoding and projection unit 503, configured to jump-connect the first feature map and the initial latent space code and input them into the decoder for decoding and projection, so as to obtain a generation mask of the bone CT training image;
[0102] The mask discriminating unit 504 is used to input the real mask and the generated mask into the discriminator for discrimination, and the output function in the discriminator outputs a discrimination result including a real value and a pseudo value.
[0103] In one embodiment, the first parameter updating unit 403 includes:
[0104] A reverse reasoning unit, used for reverse reasoning the generated mask to obtain a reverse latent space encoding;
[0105] A cross entropy calculation unit is used to calculate the entropy of the real mask and the real value in the discrimination result to obtain a first cross entropy loss function; calculate the entropy of the generated mask and the pseudo value in the discrimination result to obtain a second cross entropy loss function; calculate the entropy of the reverse latent space encoding and the real mask to obtain a third cross entropy loss function;
[0106] The first loss calculation unit is used to sum the first cross entropy loss function, the second cross entropy loss function and the third cross entropy loss function according to the following formula to obtain the first loss function:
[0107]
[0108] in, represents the first loss function, represents the first cross entropy loss function, D represents the decoder, G represents the discriminator, f' represents the first feature map, c represents the initial latent space encoding, 0 represents the pseudo value, represents the second cross entropy loss function, y represents the true mask, 1 represents the true value, represents the third cross entropy loss function, and c' represents the reverse latent space encoding.
[0109] In one embodiment, the second parameter updating unit 405 includes:
[0110] A mutual information calculation unit, configured to calculate the mutual information between the first feature map and the second feature map according to the following formula:
[0111]
[0112] Among them, I sg represents the mutual information, I represents the mutual information operator, H(f) represents the entropy of the second feature map, H(f') represents the entropy of the first feature map, H(f,f') represents the entropy of the joint distribution of the first feature map and the second feature map, P represents the joint probability distribution, and log represents the logarithmic function;
[0113] The second loss calculation unit is used to construct the second loss function by combining the mutual information and the Dice loss function:
[0114]
[0115] in, represents the second loss function, and DiceLoss represents the Dice loss function.
[0116] In one embodiment, the decoding and projection unit 503 includes:
[0117] A skip connection unit, configured to perform a first skip connection on the first feature map and the initial latent space encoding, and input a result of the first skip connection to the decoder having multiple convolutional layers;
[0118] A first convolution unit, used for performing a first convolution process on a result of the first jump connection using a first convolution layer of the decoder, and outputting a result of the first convolution process;
[0119] A second convolution unit is used to perform a second jump connection on the result of the first convolution processing and the initial latent space code, and input the result of the second jump connection to the second convolution layer for a second convolution processing, and then the second convolution layer outputs the result of the second convolution processing;
[0120] A third convolution unit, used for inputting the result of the second convolution processing into the third convolution layer for a third convolution processing, and the third convolution layer outputs the result of the third convolution processing;
[0121] The mask generation unit is used to input the result of the third convolution processing to the next convolution layer to continue the convolution processing, and the next convolution layer outputs the corresponding convolution processing result, and so on, until the last convolution layer outputs the last convolution processing result, and the last convolution processing result is used as the generated mask.
[0122] In one embodiment, the downsampling processing unit 501 includes:
[0123] A visual conversion unit is used to input the true mask into a plurality of visual converters arranged in succession, and use the output result of the last visual converter as the first feature map; wherein each visual converter includes a vector embedding layer, an attention layer, a multi-layer perceptron and a normalization layer in sequence.
[0124] Since the embodiments of the apparatus part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the apparatus part, which will not be repeated here.
[0125] The embodiment of the present invention further provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed, the steps provided in the above embodiment can be implemented. The storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
[0126] The embodiment of the present invention also provides a computer device, which may include a memory and a processor, wherein a computer program is stored in the memory, and when the processor calls the computer program in the memory, the steps provided in the above embodiment may be implemented. Of course, the computer device may also include various network interfaces, power supplies and other components.
[0127] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of this application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of this application.
[0128] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprises", "comprising" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A bone CT image segmentation method, characterized in that: include: Obtain bone CT training images and their true masks; Inputting the real mask of the bone CT training image into an encoder for feature extraction to obtain a first feature map, decoding the first feature map through a decoder to obtain a corresponding generated mask, and then using a discriminator to discriminate the real mask and the generated mask respectively; Constructing a first loss function based on the discrimination result of the discriminator, and updating the parameters of the encoder, the decoder and the discriminator by using the first loss function to construct a pre-trained model; Inputting the bone CT training image into the pre-training model, extracting the second feature map from the bone CT training image through the encoder in the pre-training model, and then generating a training image segmentation result for the second feature map through the decoder in the pre-training model, thereby constructing an initial segmentation model; Calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, and updating the parameters of the initial segmentation model by using the second loss function to construct a bone CT image segmentation model; The bone CT image segmentation model is used to perform image segmentation processing on the designated bone CT image.
2. The bone CT image segmentation method according to claim 1, characterized in that: The step of obtaining the bone CT training image and its true mask includes: After acquiring the bone CT training image, resampling the bone CT training image according to a preset sampling interval to adjust the image size of the bone CT training image; The resampled bone CT training image is subjected to image standardization processing.
3. The bone CT image segmentation method according to claim 1, characterized in that: The real mask of the bone CT training image is input into an encoder for feature extraction to obtain a first feature map, and the first feature map is decoded by a decoder to obtain a corresponding generated mask, and then the real mask and the generated mask are respectively discriminated by a discriminator, including: Downsampling the true mask by the encoder to extract the first feature map; Acquire the number of target bone types contained in the bone CT training image according to the true mask, and initialize the latent space encoding according to the number of target bone types to obtain an initial latent space encoding; The first feature map and the initial latent space encoding are jump-connected and input into the decoder for decoding and projection to obtain a generation mask of the bone CT training image; The real mask and the generated mask are input into the discriminator for discrimination, and the output function in the discriminator outputs a discrimination result including a real value and a false value.
4. The bone CT image segmentation method according to claim 3, characterized in that: The constructing a first loss function based on the discrimination result of the discriminator includes: Reverse reasoning the generated mask to obtain a reverse latent space encoding; Calculate the entropy of the true mask and the true value in the discrimination result to obtain a first cross entropy loss function; calculate the entropy of the generated mask and the pseudo value in the discrimination result to obtain a second cross entropy loss function; calculate the entropy of the reverse latent space encoding and the true mask to obtain a third cross entropy loss function; According to the following formula, the first cross entropy loss function, the second cross entropy loss function and the third cross entropy loss function are summed to obtain the first loss function: in, represents the first loss function, represents the first cross entropy loss function, D represents the decoder, G represents the discriminator, f′ represents the first feature map, c represents the initial latent space encoding, 0 represents the pseudo value, represents the second cross entropy loss function, y represents the true mask, 1 represents the true value, represents the third cross entropy loss function, and c′ represents the reverse latent space encoding.
5. The bone CT image segmentation method according to claim 1, characterized in that: The calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, includes: The mutual information between the first feature map and the second feature map is calculated according to the following formula: Among them, I sg represents the mutual information, I represents the mutual information operator, H(f) represents the entropy of the second feature map, H(f′) represents the entropy of the first feature map, H(f, f′) represents the entropy of the joint distribution of the first feature map and the second feature map, P represents the joint probability distribution, and log represents the logarithmic function; The second loss function is constructed by combining the mutual information and the Dice loss function: in, represents the second loss function, and DiceLoss represents the Dice loss function.
6. The bone CT image segmentation method according to claim 3, characterized in that: The first feature map and the initial latent space encoding are jump-connected and then input into the decoder for decoding and projection to obtain the generation mask of the bone CT training image, including: Performing a first skip connection between the first feature map and the initial latent space encoding, and inputting the result of the first skip connection into the decoder having multiple convolutional layers; Using the first convolution layer of the decoder to perform a first convolution process on the result of the first skip connection, and outputting the result of the first convolution process; Performing a second jump connection on the result of the first convolution process and the initial latent space code, and inputting the result of the second jump connection into the second convolution layer for a second convolution process, and then outputting the result of the second convolution process by the second convolution layer; Inputting the result of the second convolution processing to the third convolution layer for the third convolution processing, and the third convolution layer outputs the result of the third convolution processing; The result of the third convolution processing is input to the next convolution layer to continue the convolution processing, and the next convolution layer outputs the corresponding convolution processing result, and so on, until the last convolution layer outputs the last convolution processing result, and the last convolution processing result is used as the generated mask.
7. The bone CT image segmentation method according to claim 3, characterized in that: The downsampling the real mask by the encoder to extract the first feature map includes: The true mask is input into a plurality of visual converters arranged in succession, and the output result of the last visual converter is used as the first feature map; wherein each visual converter includes a vector embedding layer, an attention layer, a multi-layer perceptron and a normalization layer in sequence.
8. A bone CT image segmentation device, characterized in that: include: An image acquisition unit, used for acquiring a bone CT training image and its true mask; A mask processing unit, configured to input the real mask of the bone CT training image into an encoder for feature extraction to obtain a first feature map, decode the first feature map through a decoder to obtain a corresponding generated mask, and then use a discriminator to discriminate the real mask and the generated mask respectively; A first parameter updating unit, configured to construct a first loss function based on a discrimination result of the discriminator, and to update parameters of the encoder, the decoder and the discriminator by using the first loss function, so as to construct a pre-trained model; A segmentation training unit, used for inputting the bone CT training image into the pre-training model, extracting the second feature map from the bone CT training image through the encoder in the pre-training model, and then generating a training image segmentation result for the second feature map through the decoder in the pre-training model, so as to construct an initial segmentation model; A second parameter updating unit, used for calculating the mutual information between the first feature map and the second feature map, and constructing a second loss function based on the mutual information, and performing parameter updating on the initial segmentation model by using the second loss function to construct a bone CT image segmentation model; The designated image segmentation unit is used to perform image segmentation processing on the designated bone CT image by using the bone CT image segmentation model.
9. A computer device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the bone CT image segmentation method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the bone CT image segmentation method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
CT image multi-region segmentation method and device, electronic equipment and storage medium
CN117058172A
Fracture image segmentation method and device based on deep learning, equipment and medium
CN117649421A
Cited By
Data processing method and device, electronic equipment, vehicle and storage medium
CN119048762A
Medical image segmentation method and system based on uncertainty knowledge modeling
CN119151907A
