A method and device for calculating loss function of tooth and pulp segmentation network based on uncertainty enhancement
By introducing uncertainty enhancement terms into the loss function, the uncertainty weighted spectrum and loss of the tooth and pulp segmentation network are calculated, and the problem of loss of the tooth and pulp segmentation boundary in CBCT images is solved, achieving more accurate segmentation results and model performance improvement.
Patent Information
- Application Number
- CN202411280210.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-12
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2044-09-12
AI Technical Summary
The existing loss function is prone to loss of the tooth-pulp segmentation boundary in CBCT images because these functions fail to effectively focus on the low confidence areas of tooth-pulp segmentation, which makes the model unable to effectively focus on these areas during the training stage.
A loss function calculation method based on uncertainty enhancement is proposed. By calculating the uncertainty weighted spectrum of each category and calculating the uncertainty enhancement loss, the network's attention to weak details of teeth and pulp, including softmax calculation Predict the probability spectrum, obtain the binary mask truth label, calculate the uncertainty weighted spectrum and uncertainty enhancement loss, and update the network parameters through the gradient until the loss function is less than or equal to the preset value.
The accuracy of the teeth and pulp segmentation results was improved, the Dice coefficient was increased by 1% on average, and the end segmentation length of the pulp was extended by 2-3mm, which significantly improved the segmentation performance of the model.
Smart Images

Figure CN118799656B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of computer vision and artificial intelligence, and specifically relates to a loss function calculation method and device for a tooth and dental pulp segmentation network based on uncertainty enhancement. Background Art
[0002] In the image segmentation task of deep learning, loss functions play a key role in guiding model training. The goal of image segmentation is to divide an image into different regions or categories, such as the target object and background in semantic segmentation. To achieve this goal, the loss function needs to accurately evaluate the difference between the predicted result and the actual label. Common loss functions include cross-entropy loss and Dice coefficient loss. Cross-entropy loss is a loss function that measures the difference between the actual category and the predicted probability, and is suitable for multi-class segmentation problems. Dice coefficient loss measures the overlap ratio between the predicted area and the true area, and is often used in fields such as medical image segmentation. In general, choosing an appropriate loss function can effectively solve the specific needs of different tasks and data sets and improve the segmentation performance of the model. Recent research has also focused on combined loss, multi-scale loss, and adaptive loss to further optimize the model. However, these proposed loss functions cannot effectively solve the problem of easy loss of the tooth and pulp segmentation boundary in CBCT images. The main reason is that these loss functions do not take into account the existence of a large number of low-confidence areas in the tooth and pulp segmentation boundary, and these areas account for a very small proportion of the entire target segmentation volume, resulting in the network being unable to effectively focus on these areas during the training phase. Therefore, there is an urgent need for a loss function for high-precision segmentation of teeth and pulp. Summary of the invention
[0003] The present invention proposes a loss function calculation method and device for tooth and pulp segmentation network based on uncertainty enhancement, aiming to enhance the network model's attention to the weak detail areas of teeth and pulp during training, and at the same time improve the network model's ability to distinguish low-confidence prediction areas.
[0004] In a first aspect, the present invention proposes a loss function calculation method for a tooth and dental pulp segmentation network based on uncertainty enhancement, comprising the following steps:
[0005] Step 1: Calculate the predicted probability spectrum of tooth and pulp segmentation of the CBCT image input to the backbone network through softmax ,in Indicates category;
[0006] Step 2: Obtain the segmentation mask truth label of the tooth and pulp of the CBCT image and perform one-hot encoding on it to obtain the binary mask truth label ;
[0007] Step 3: Calculate the uncertainty weighted spectrum of each category based on the segmentation prediction probability spectrum of each category output by the network, as shown in the following formula:
[0008] Uncertainty weighted spectrum for each category ,in, Indicates the uncertainty threshold hyperparameter;
[0009] Step 4: Calculate the uncertainty enhancement loss using the calculated uncertainty weighted spectrum for each category, as follows:
[0010] , where is the uncertainty enhancement loss, Indicates element-wise summation.
[0011] Furthermore, according to the actual effect and actual application scenario, Make fine adjustments; The setting range is ,when When is 0.3, the loss function calculates the loss of the area where the prediction confidence is less than 0.8. When is 0.45, the loss function calculates the loss for areas where the confidence is lower than 0.95.
[0012] Furthermore, the method further comprises:
[0013] Calculating the gradient value of the loss function;
[0014] Update network parameters based on the gradient value;
[0015] The loss function is calculated repeatedly using the updated network parameters until the loss function is less than or equal to a preset value.
[0016] In a second aspect, the present invention proposes a loss function calculation device for a tooth and dental pulp segmentation network based on uncertainty enhancement, the device comprising:
[0017] The prediction probability spectrum acquisition module is used to obtain the tooth and pulp segmentation prediction probability spectrum of the CBCT image input into the backbone network ,in Indicates category;
[0018] Segmentation mask truth label calculation module, used to obtain the binary mask truth label of teeth and dental pulp in CBCT images ;
[0019] The uncertainty weighted spectrum acquisition module calculates the uncertainty weighted spectrum according to the segmentation prediction probability spectrum of each class output by the network. The module uses the following formula for calculation:
[0020] ,in, represents the uncertainty threshold hyperparameter;
[0021] A first calculation module calculates uncertainty enhancement loss using the calculated uncertainty weighted spectrum of each category, wherein the first calculation module includes:
[0022] The calculation submodule calculates the uncertainty enhancement loss using the following formula:
[0023] , where is the uncertainty enhancement loss, Indicates element-wise summation.
[0024] Furthermore, the device also includes:
[0025] A second calculation module is used to calculate the gradient value of the loss function;
[0026] An updating module, used for updating network parameters based on the gradient value;
[0027] The third calculation module is used to repeatedly calculate the loss function using the updated network parameters until the loss function is less than or equal to a preset value.
[0028] The present invention solves the problem that the tooth and pulp segmentation boundary is easily lost in CBCT images, making the tooth and pulp segmentation results more accurate. The dice coefficient of the evaluation index can be improved by an average of up to 1%. At the same time, the segmentation length of the pulp end is also extended by 2-3mm, effectively improving the segmentation performance of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0030] Figure 1 It is the algorithm flow chart of the present invention;
[0031] Figure 2 It is a structural block diagram of the device of the present invention. DETAILED DESCRIPTION
[0032] In the task of semantic segmentation of teeth and pulp in CBCT images, in order to make the network model training more stable while taking into account the segmentation performance, it is necessary to select the uncertainty threshold hyperparameter according to the actual effect and actual application scenario.
[0033] Example 1
[0034] See also Figure 1 , a loss function calculation method for tooth and pulp segmentation network based on uncertainty enhancement, comprising the following steps:
[0035] Step 1: Calculate the predicted probability spectrum of tooth and pulp segmentation of the CBCT image input to the backbone network through softmax ,in Indicates category;
[0036] Step 2: Obtain the segmentation mask truth label of the tooth and pulp of the CBCT image and perform one-hot encoding on it to obtain the binary mask truth label ;
[0037] Step 3: Calculate the uncertainty weighted spectrum of each category based on the segmentation prediction probability spectrum of each category output by the network, as shown in the following formula:
[0038] Uncertainty weighted spectrum for each category ,in, represents the uncertainty threshold hyperparameter;
[0039] Step 4: Calculate the uncertainty enhancement loss using the calculated uncertainty weighted spectrum for each category, as follows:
[0040] , where is the uncertainty enhancement loss, Indicates element-wise summation;
[0041] Step 5: According to the actual effect and actual application scenario, Perform fine-tuning; in this embodiment, Set to 0.4;
[0042] Step 6: Calculate the gradient value of the loss function;
[0043] Step 7: Update network parameters based on the gradient value;
[0044] Step 8: Repeat the calculation of the loss function using the updated network parameters until the loss function is less than or equal to a preset value.
[0045] Example 2
[0046] See also Figure 2 , a loss function calculation device for tooth and pulp segmentation network based on uncertainty enhancement, the device comprising:
[0047] The prediction probability spectrum acquisition module is used to obtain the tooth and pulp segmentation prediction probability spectrum of the CBCT image input into the backbone network ,in Indicates category;
[0048] Segmentation mask truth label calculation module, used to obtain the binary mask truth label of teeth and dental pulp in CBCT images ;
[0049] The uncertainty weighted spectrum acquisition module calculates the uncertainty weighted spectrum according to the segmentation prediction probability spectrum of each class output by the network. The module uses the following formula for calculation:
[0050] ,in, represents the uncertainty threshold hyperparameter. In this embodiment, Set to 0.4;
[0051] A first calculation module calculates uncertainty enhancement loss using the calculated uncertainty weighted spectrum of each category, wherein the first calculation module includes:
[0052] The calculation submodule calculates the uncertainty enhancement loss using the following formula:
[0053] , where is the uncertainty enhancement loss, Indicates element-wise summation.
[0054] The device also includes:
[0055] A second calculation module is used to calculate the gradient value of the loss function;
[0056] An updating module, used for updating network parameters based on the gradient value;
[0057] The third calculation module is used to repeatedly calculate the loss function using the updated network parameters until the loss function is less than or equal to a preset value.
[0058] Those skilled in the art should understand that the first, second and third in the present invention merely refer to different application stages.
[0059] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A loss function calculation method for tooth and pulp segmentation network based on uncertainty enhancement, characterized in that: The following steps are involved: Step 1: Calculate the predicted probability spectrum of tooth and pulp segmentation of the CBCT image input to the backbone network through softmax ,in Indicates category; Step 2: Obtain the segmentation mask truth label of the tooth and pulp of the CBCT image and perform one-hot encoding on it to obtain the binary mask truth label ; Step 3: Calculate the uncertainty weighted spectrum of each category based on the segmentation prediction probability spectrum of each category output by the network, as shown in the following formula: Uncertainty weighted spectrum for each category ,in, Indicates the uncertainty threshold hyperparameter; Step 4: Calculate the uncertainty enhancement loss using the calculated uncertainty weighted spectrum for each category, as follows: , where is the uncertainty enhancement loss, Indicates element-wise summation.
2. The method for calculating the loss function of a tooth and dental pulp segmentation network based on uncertainty enhancement according to claim 1, characterized in that: According to the actual effect and actual application scenario, Make fine adjustments; The setting range is ,when When is 0.3, the loss function calculates the loss of the area where the prediction confidence is less than 0.
8. When is 0.45, the loss function calculates the loss for areas where the confidence is lower than 0.
95.
3. The method for calculating the loss function of a tooth and dental pulp segmentation network based on uncertainty enhancement according to claim 1, characterized in that: The method further comprises: Calculating the gradient value of the loss function; Update network parameters based on the gradient value; The loss function is calculated repeatedly using the updated network parameters until the loss function is less than or equal to a preset value.
4. A loss function calculation device for tooth and pulp segmentation network based on uncertainty enhancement, characterized in that: The device includes: The prediction probability spectrum acquisition module is used to obtain the tooth and pulp segmentation prediction probability spectrum of the CBCT image input into the backbone network ,in Indicates category; Segmentation mask truth label calculation module, used to obtain the binary mask truth label of teeth and dental pulp in CBCT images ; The uncertainty weighted spectrum acquisition module calculates the uncertainty weighted spectrum according to the segmentation prediction probability spectrum of each class output by the network. The module uses the following formula for calculation: ,in, represents the uncertainty threshold hyperparameter; A first calculation module calculates uncertainty enhancement loss using the calculated uncertainty weighted spectrum of each category, wherein the first calculation module includes: The calculation submodule calculates the uncertainty enhancement loss using the following formula: , where is the uncertainty enhancement loss, Indicates element-wise summation.
5. The device for calculating the loss function of a tooth and dental pulp segmentation network based on uncertainty enhancement according to claim 4, characterized in that: The device also includes: A second calculation module is used to calculate the gradient value of the loss function; An updating module, used for updating network parameters based on the gradient value; The third calculation module is used to repeatedly calculate the loss function using the updated network parameters until the loss function is less than or equal to a preset value.
