Medical image segmentation model training method, device, equipment, medium and product
By determining boundary image elements and calculating boundary complexity in a medical image segmentation model, and generating adaptive adjustment coefficients, the problem of insufficient ability to distinguish local boundary morphological differences in existing technologies is solved, and more accurate medical image segmentation is achieved.
Patent Information
- Application Number
- CN202611673530.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-28
- Publication Date
- 2026-11-27
AI Technical Summary
Existing medical image segmentation models struggle to effectively distinguish local boundary morphological differences when processing targets such as organs and lesions. This results in the training loss being unable to be adjusted differentially for different local boundary morphologies, thus limiting the model's ability to distinguish local boundary morphologies.
By acquiring medical images and determining the set of image elements and calculating categories, boundary image elements are determined using binary labels and preset neighborhood templates. First and second boundary counts are calculated, boundary complexity is generated, and the model is updated based on adaptive adjustment coefficients to achieve adaptive adjustment of category-level overlap loss.
This improves the ability of medical image segmentation models to distinguish differences in local boundary morphology, solves the problem of insufficient local boundary morphology description in existing technologies, and achieves more accurate medical image segmentation.
Smart Images

Figure CN123180263A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical image processing and artificial intelligence model training, and in particular to a method, apparatus, device, medium and product for training a medical image segmentation model. Background Technology
[0002] Medical image segmentation models typically construct a training loss by comparing the differences between the model's predictions and human annotations, and update the model parameters based on this training loss. Existing training methods usually employ cross-entropy loss, region-based overlap loss, or a combination thereof, to constrain the pixel categories predicted by the model and the overall overlap between the predicted and ground truth regions, thereby improving the consistency between medical image segmentation results and human annotation results.
[0003] For medical image targets such as organs and lesions, their boundaries often exhibit morphological differences. To enhance the model's attention to target boundaries, existing training methods can adjust the training loss based on information such as the location, number, or area of the target boundary. Among these methods, the method based on the number of image elements at the target boundary can reflect the overall scale of the target boundary, but it usually lacks further distinction regarding the composition of the local neighborhoods surrounding different boundary image elements.
[0004] Therefore, when different target regions have the same number of target boundary image elements and the same target region area, but different local boundary morphologies, training methods that adjust based solely on the number of target boundary image elements may produce the same or similar boundary descriptions, making it difficult to further reflect the local neighborhood differences between different boundary locations. This limits the ability of the training loss to be adjusted differentially for different local boundary morphologies. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, device, medium, and product for training a medical image segmentation model, so as to improve the ability of the medical image segmentation model to distinguish local boundary morphological differences.
[0006] To achieve the above objectives, this application provides the following solution: Firstly, this application provides a method for training a medical image segmentation model, including: Acquire medical images and determine the set of image elements and at least one computed category for the medical images; A binary label is used to determine the computation category in a set of image elements. The binary label includes a first label and a second label, where the first label indicates that the image element in the set of image elements belongs to the computation category; and the second label indicates that the image element does not belong to the computation category. Based on binary labels and a preset neighborhood template, image elements that belong to the calculation category and have a second label within the preset neighborhood template are identified as boundary image elements of the calculation category, and the number of boundary image elements is counted to obtain the first boundary count of the calculation category. The second boundary count of the calculation category is calculated based on the number of image elements belonging to the same calculation category as the boundary image element within a preset neighborhood template. The boundary complexity of the computation category is obtained by weighted summation of the first boundary count and the second boundary count. An adaptive adjustment coefficient is generated based on the boundary complexity and the target region area of the computation category. The target region area is the number of first labels in the binary labels. The medical image is input into the medical image segmentation model to obtain a category prediction probability map for calculating the category. The class-level overlap loss is calculated based on the adaptive adjustment coefficient, the class prediction probability map, and the binary label, and the medical image segmentation model is updated based on the class-level overlap loss.
[0007] Optionally, when there are multiple categories, the medical image segmentation model is updated based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label to calculate the category-level overlap loss, and the model is updated based on the category-level overlap loss. The model further includes: The category-level overlap loss for each computational category is calculated based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label. The total loss is obtained by taking the arithmetic mean of the category-level overlap losses for all calculated categories. The medical image segmentation model is updated based on the total loss.
[0008] Optionally, based on binary labels and a preset neighborhood template, image elements belonging to the computational category and containing a second label within the preset neighborhood template are determined as boundary image elements of the computational category, specifically including: Set the tag value of the first tag to 1, and set the tag value of the second tag to 0; The binary label is convolved with a preset neighborhood template and then multiplied element-wise with the binary label to obtain the neighborhood response map of the binary label. The neighborhood response map includes the neighborhood response value of each image element. The neighborhood response value that is equal to the maximum neighborhood response value in the neighborhood response map is set to 0 to obtain the boundary response map; where the maximum neighborhood response value is determined according to the preset neighborhood template; Image elements with non-zero neighborhood response values in the boundary response map are identified as boundary image elements.
[0009] Optionally, a second boundary count of the calculation category is calculated based on the number of image elements belonging to the same calculation category as the boundary image element within a preset neighborhood template, specifically including: Based on the preset weight adjustment index and the neighborhood response value of the boundary image element, the local heterogeneity weight of each boundary image element in the boundary response map is calculated. The larger the neighborhood response value, the smaller the local heterogeneity weight. The second boundary count is obtained by summing the local heterogeneity weights of all boundary image elements.
[0010] Optionally, an adaptive adjustment coefficient is generated based on the boundary complexity and the area of the target region of the computational category, specifically including: Calculate the ratio of boundary complexity to the area of the target region; The initial adjustment coefficient is determined based on the ratio, where the larger the ratio, the smaller the initial adjustment coefficient. The initial adjustment coefficient is compared with the preset adaptive adjustment threshold, and the smaller of the two is determined as the adaptive adjustment coefficient.
[0011] Optionally, the category-level overlap loss is calculated based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, specifically including: Based on the category prediction probability map, determine the sum of squared prediction probabilities of the category prediction probability map, where the sum of squared prediction probabilities is the sum of the squares of the prediction probabilities of each image element in the category prediction probability map; Based on the binary labels, determine the number of first labels in the binary labels; Based on the category prediction probability map and the binary label, determine the intersection of the category prediction probability map and the binary label, where the intersection is the sum of the products of the prediction probability of the category prediction probability map and the binary label on the same image element and the label value of the binary label; The intersection terms are adjusted according to the adaptive adjustment coefficient to obtain the adjusted intersection terms; The category-level overlap loss is calculated based on the sum of squared predicted probabilities, the number of first labels, the adjusted intersection terms, and the preset smoothing constant.
[0012] Secondly, this application provides a medical image segmentation model training device, comprising: An image acquisition module is used to acquire medical images and determine the set of image elements and at least one computational category of the medical images; The label determination module is used to determine the binary label of the computation category in the image element set. The binary label includes a first label and a second label, wherein the first label indicates that the image element in the image element set belongs to the computation category; and the second label indicates that the image element does not belong to the computation category. The first counting module is used to determine the image elements that belong to the calculation category and have a second label in the preset neighborhood template as boundary image elements of the calculation category based on the binary label and the preset neighborhood template, and to count the number of boundary image elements to obtain the first boundary count of the calculation category. The second counting module is used to calculate the second boundary count of the calculation category based on the number of image elements belonging to the same calculation category as the boundary image elements within a preset neighborhood template. The coefficient generation module is used to obtain the boundary complexity of the computation category by weighted summation of the first boundary count and the second boundary count, and to generate an adaptive adjustment coefficient based on the boundary complexity and the target region area of the computation category; wherein, the target region area is the number of first labels in the binary labels; The probability acquisition module is used to input medical images into the medical image segmentation model to obtain a category prediction probability map for calculating the category. The loss update module is used to calculate the category-level overlap loss based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, and to update the medical image segmentation model based on the category-level overlap loss.
[0013] Thirdly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the medical image segmentation model training method described above.
[0014] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the medical image segmentation model training method described above.
[0015] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the medical image segmentation model training method described above.
[0016] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides a method, apparatus, device, medium, and product for training a medical image segmentation model. The application determines binary labels for computational categories within a set of image elements, and identifies boundary image elements based on these binary labels and a preset neighborhood template. The number of boundary image elements is counted to obtain a first boundary count. This first boundary count reflects the total number of boundary image elements within a computational category. Further, the application calculates a second boundary count based on the number of image elements within the preset neighborhood template that belong to the same computational category as the boundary image element. Since the second boundary count reflects the composition of the local neighborhood around the boundary image element, it reflects the local heterogeneity between different boundary image elements. The second boundary count does not directly use the local heterogeneity weights as pixel-level loss weights. Instead, it aggregates the local heterogeneity weights of each boundary image element within the computational category to form a category-level statistic, which is then combined with the first boundary count to simultaneously retain both overall boundary scale information and local neighborhood heterogeneity information. Therefore, the second boundary count is not a replacement for the first boundary count, but rather, together with the first boundary count, constitutes a complementary boundary description with different informational meanings.
[0017] Based on this, this application obtains the boundary complexity by weighted summation of the first and second boundary counts, thus introducing local neighborhood heterogeneity of boundary image elements while preserving the overall scale of the boundary. Next, this application generates an adaptive adjustment coefficient based on the boundary complexity and the target region area, allowing the adaptive adjustment coefficient to vary with both the boundary complexity and the target region area. After inputting the medical image into the medical image segmentation model to obtain the category prediction probability map, this application calculates the category-level overlap loss based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, and updates the medical image segmentation model based on the category-level overlap loss.
[0018] Therefore, for computational categories with the same first boundary count and target region area but different local boundary morphologies, this application can obtain different second boundary counts, boundary complexities, and adaptive adjustment coefficients, thereby obtaining different category-level overlap loss adjustment results. Thus, this application can solve the problem of existing technologies' difficulty in differentially adjusting computational categories with different local boundary morphologies, improving the ability of medical image segmentation models to distinguish differences in local boundary morphology. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is an application environment diagram of a medical image segmentation model training method in one embodiment of this application; Figure 2 A flowchart illustrating a medical image segmentation model training method provided in an embodiment of this application; Figure 3 for Figure 2 A detailed flowchart of step 203; Figure 4 for Figure 2 A detailed flowchart of step 204; Figure 5 for Figure 2 A detailed flowchart of step 205; Figure 6 for Figure 2 A detailed flowchart of step 207; Figure 7 A schematic diagram of a binary label provided in an embodiment of this application; Figure 8 A schematic diagram of a binary label provided in another embodiment of this application; Figure 9 A schematic diagram of the functional modules of a medical image segmentation model training device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0023] The medical image segmentation model training method provided in this application embodiment can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on other servers. Terminal 102 can send medical images to server 104. After receiving the medical images, server 104 processes them and executes the medical image segmentation model training method provided in this application embodiment to obtain a trained medical image segmentation model. The server can provide feedback on the training results to the terminal. Furthermore, in some embodiments, the medical image segmentation model training method can also be implemented independently by server 104 or terminal 102. For example, terminal 102 can directly train the medical image segmentation model on the medical images, or server 104 can obtain medical images from the data storage system and train the medical image segmentation model on the medical images. Terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers, or it can be a cloud server.
[0024] In one exemplary embodiment, such as Figure 2 As shown, a method for training a medical image segmentation model is provided. This method is executed by a computer device, specifically by a terminal or server alone, or by both a terminal and a server. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the explanation includes the following steps 201 to 207. Wherein: Step 201: Acquire a medical image and determine the set of image elements and at least one computational category of the medical image.
[0025] Medical images are obtained by preprocessing the original images, and the preprocessing method can be adjusted according to the type of the original image.
[0026] For example, the original image is a two-dimensional medical image with pixel values ranging from 0 to 255. The server performs intensity normalization on the two-dimensional medical image, unifying the pixel value range to between 0 and 1. Then, it resizes the two-dimensional medical image to a preset size and performs channel adaptation to finally obtain a single-channel medical image.
[0027] For example, the original image is a two-dimensional slice, which can be a unimodal slice or a multimodal slice. For a unimodal slice, the original image is a single-layer 2D slice within a 3D medical volume dataset, with pixel values ranging from -1024 to 3071. The server first performs window width and window level transformation on the unimodal slice, mapping the pixel value range of the region of interest to 0 to 255. Then, intensity normalization is performed to unify the pixel value range to between 0 and 1. Finally, the slice is resized to a preset size and adapted to different channels to obtain a single-channel medical image.
[0028] For multimodal slicing, the original image includes two-dimensional slices of multiple modalities, each with a different range of pixel values. The server first performs intensity normalization on each modal image to unify the pixel value range of each modality to between 0 and 1. Then, it performs size adjustment to scale each modal image to the same preset size. Finally, it performs channel adaptation to stitch the multiple modal images together in the channel dimension to obtain a multi-channel medical image.
[0029] The image element set is determined based on the actual training configuration and is used to represent the computational range of the medical image. For example, the image element set can be an entire two-dimensional slice of a medical image, an image patch, a two-dimensional slice of a certain layer in three-dimensional volumetric data, or a valid region after excluding ignored areas. Furthermore, when the medical image is two-dimensional, the image elements are pixels; when the medical image is three-dimensional, the image elements are voxels.
[0030] The computation category is also determined based on the actual training configuration and is used to represent the category involved in the computation. For example, when the actual training task is a liver segmentation task, the computation category is liver; when the actual training task is a multi-organ segmentation task, the computation category may include multiple categories such as liver, kidney, and spleen.
[0031] Step 202: Determine the binary label of the calculated category in the set of image elements.
[0032] The binary label includes a first label and a second label, where the first label indicates that the image element in the image element set belongs to the computation category; the second label indicates that the image element does not belong to the computation category.
[0033] Binary labels are determined based on the ground truth segmentation label corresponding to the original image and the set of image elements. For example, when the ground truth segmentation label corresponding to the original image is a multi-class label map, the server determines the image elements in the set of image elements whose ground truth segmentation label value is equal to the class index of the calculated class as the first label, and determines the image elements whose ground truth segmentation label value is not equal to the class index of the calculated class as the second label.
[0034] For example, when the actual segmentation label corresponding to the original image is itself a binary label for that computational category, the server directly obtains the binary label for that computational category from the image element set.
[0035] In some embodiments, the first label is 1 and the second label is 0. For each image element in the image element set, if it belongs to the calculation category, the binary label is 1; if it does not belong to the calculation category, the binary label is 0.
[0036] Step 203: Based on the binary label and the preset neighborhood template, the image elements that belong to the calculation category and have a second label in the preset neighborhood template are determined as the boundary image elements of the calculation category, and the number of boundary image elements is counted to obtain the first boundary count of the calculation category.
[0037] The preset neighborhood template is used to count the number of image elements belonging to the same computational category around each target image element. Here, a target image element refers to an image element with a binary label as its first label.
[0038] For example, the preset neighborhood template is a 3×3 cross-shaped neighborhood template, which includes the center position and four adjacent positions: top, bottom, left, and right. Therefore, the maximum neighborhood response value of a single target image element is 5. It is understandable that the preset neighborhood template can also be set to other forms according to the actual training configuration, as long as it can count the number of image elements belonging to the same computational category around the target image element.
[0039] The server convolves a preset neighborhood template with the binary label of the computation category to obtain a convolution result image of the computation category. Then, it multiplies this convolution result image element-wise with the binary label of the computation category to obtain a neighborhood response image of that computation category. Element-wise multiplication with the binary label is used to set the response of non-target image elements to the second label, for example, to 0. For a target image element with a binary label of the first label, the neighborhood response value in the neighborhood response image represents the number of image elements belonging to that computation category, including the target image element itself and its four adjacent neighbors (upper, lower, left, and right). When the neighborhood response value equals the maximum neighborhood response value of 5, it indicates that the target image element and its four adjacent neighbors all belong to that computation category, and the target image element is an internal image element. When the neighborhood response value is less than 5, it indicates that there are image elements near the target image element that do not belong to that computation category, and the target image element is identified as a candidate boundary image element.
[0040] Then, the server sets the target internal image element whose neighborhood response value is equal to the maximum neighborhood response value of 5 in the neighborhood response map as the second label, for example, set it to 0, to obtain the boundary response map of this calculation category. Since non-target image elements have already been set as the second label during the neighborhood response calculation, after internal position suppression, the non-zero positions in the boundary response map correspond to the boundary image elements of this calculation category.
[0041] The server counts the number of non-zero locations in the boundary response graph to obtain the first boundary count for that computation category. The first boundary count indicates how many boundary image elements the computation category has; it can also be called the hard boundary count. The first boundary count is used to preserve the overall scale of the computation category boundary.
[0042] Step 204: Calculate the second boundary count of the calculation category based on the number of image elements belonging to the same calculation category as the boundary image element within the preset neighborhood template.
[0043] Second boundary counting, also known as soft boundary counting, differs from first boundary counting, which only counts the number of boundary image elements. Second boundary counting further differentiates each boundary image element based on its local neighborhood composition.
[0044] Specifically, for each non-zero position in the boundary response graph, i.e. each boundary image element, the server calculates the local heterogeneity weight of the boundary image element based on the number of image elements belonging to the same calculation category as the boundary image element within a preset neighborhood template.
[0045] The neighborhood response value of a boundary image element is the number of image elements belonging to the same computational category as that boundary image element within a preset neighborhood template. This neighborhood response value is less than the maximum neighborhood response value of 5. A smaller neighborhood response value indicates fewer image elements belonging to the same computational category surrounding the boundary image element, stronger local neighborhood heterogeneity, and a higher corresponding local heterogeneity weight. Conversely, a larger neighborhood response value indicates more image elements belonging to the same computational category surrounding the boundary image element, more regular local boundaries, and a lower corresponding local heterogeneity weight.
[0046] For example, the preset neighborhood template is a 3×3 cross-shaped neighborhood template, and the maximum neighborhood response value is 5. The server calculates the local heterogeneity weight based on the neighborhood response value.
[0047] The local heterogeneity weight is calculated by normalization based on the difference between the maximum neighborhood response value and the neighborhood response value of the boundary image element, and the degree of weight difference between different neighborhood responses can be controlled by a preset weight adjustment index.
[0048] For example, the preset weight adjustment index is set to 1.0. With this value, when the neighborhood response values are 4, 3, 2, and 1, the corresponding local heterogeneity weights are 0.25, 0.50, 0.75, and 1.00, respectively. It is understandable that the preset weight adjustment index can also be set to other values according to the actual training configuration.
[0049] The server sums the local heterogeneity weights of all boundary image elements to obtain a second boundary count for that computational category. This second boundary count is used to supplement the local neighborhood differences between different boundary image elements. Since the local heterogeneity weight of each boundary image element is no greater than 1, the second boundary count does not exceed the first boundary count.
[0050] Step 205: The first boundary count and the second boundary count are weighted and summed to obtain the boundary complexity of the computation category. An adaptive adjustment coefficient is generated based on the boundary complexity and the target region area of the computation category.
[0051] Boundary complexity is used to represent the overall size of the boundary and the heterogeneity of the local neighborhood of a computational class. The first boundary count represents the number of boundary image elements and is used to preserve the overall boundary size; the second boundary count represents the soft boundary count obtained based on the composition of the local neighborhoods of the boundary image elements, used to supplement the local neighborhood differences between different boundary image elements. The server weights and sums the first and second boundary counts according to a set ratio to obtain the boundary complexity of the computational class.
[0052] For example, the server multiplies the first boundary count by the first weight, multiplies the second boundary count by the second weight, and then adds the two together to obtain the boundary complexity. The sum of the first and second weights is 1. The second weight represents the proportion of the second boundary count in the boundary complexity, and its value ranges from 0 to 1.
[0053] Specifically, the second weight is set to 0.4, and the first weight is set to 0.6. When the second weight is 0, the boundary complexity degenerates to the first boundary count; when the second weight is greater than 0, local neighborhood heterogeneity participates in the boundary complexity calculation. It is understandable that the second weight can also be set to other values based on the actual training configuration.
[0054] The target region area is the number of first labels in the binary labels. For example, when the first label is 1 and the second label is 0, the server counts the number of image elements with a binary label value of 1 for that calculation category, and obtains the target region area for that calculation category. The target region area represents the number of image elements occupied by that calculation category in the image element set.
[0055] The server generates adaptive adjustment coefficients based on the boundary complexity and the target region area. The adaptive adjustment coefficients are calculated according to the relative relationship between the boundary complexity and the target region area.
[0056] In some embodiments, the adaptive adjustment coefficient is equal to 1 minus twice the ratio of the boundary complexity to the target area, and then the smaller value between this minus a preset adaptive adjustment threshold. A smoothing constant greater than 0 can be added to the ratio calculation to avoid a zero denominator and improve numerical stability; twice the boundary complexity represents a fixed scaling factor for the boundary complexity ratio in this adaptive relationship; the preset adaptive adjustment threshold is 0.8. The current calculation formula only sets an upper limit for the adaptive adjustment coefficient, without setting an additional lower limit. Therefore, when the ratio of the boundary complexity to the target area is high, the adaptive adjustment coefficient can be negative.
[0057] Through this process, computational categories with the same number of boundaries but different local neighborhood shapes can form different boundary complexities, and computational categories with the same boundary complexity but different target region areas can also obtain different adaptive adjustment coefficients. Therefore, the adaptive adjustment coefficients are simultaneously affected by the boundary size, local neighborhood heterogeneity, and target region area.
[0058] Step 206: Input the medical image into the medical image segmentation model to obtain the category prediction probability map for calculating the category.
[0059] The server inputs the medical image obtained in step 201 into the medical image segmentation model. This medical image segmentation model can be a convolutional neural network, a Transformer network, or other network structures capable of performing pixel-level classification of medical images.
[0060] The medical image segmentation model performs forward computation on the input medical image and outputs a category prediction probability map for each computational category. The category prediction probability map for each category has the same spatial dimensions as the medical image and is defined on the set of image elements. For each image element in the set of image elements, the predicted probability value in the category prediction probability map represents the probability that the image element belongs to that computational category, with a value ranging from 0 to 1.
[0061] When a medical image segmentation model outputs prediction probability maps for multiple calculated categories, the server retrieves the corresponding prediction probability map for that calculated category from the output maps, based on at least one category. For example, if the medical image segmentation model outputs prediction probability maps for multiple categories such as background, liver, and kidney, and the calculated category is liver, the server extracts the corresponding prediction probability map for liver from the model's output as the prediction probability map for that calculated category. In some embodiments, the medical image segmentation model may also directly output the prediction probability map for each calculated category, meaning the number of output channels matches the number of calculated categories.
[0062] The category prediction probability map and the binary label correspond to each image element on the same set of image elements. Therefore, for each image element in the set of image elements, there is both a binary label for the calculated category, indicating whether it truly belongs to that category, and a category prediction probability map for that category, representing the probability that the medical image segmentation model predicts it belongs to that category.
[0063] It should be noted that the execution order of step 206 is not limited to following step 205. In a specific implementation, step 206 can also be executed immediately after the medical image is acquired in step 201, that is, the medical image segmentation model first performs forward computation on the medical image to obtain a category prediction probability map for calculating the category; and then steps 202 to 205 are executed. Alternatively, step 206 can also be executed in parallel with at least one of steps 202 to 205.
[0064] Step 207: Calculate the category-level overlap loss based on the adaptive adjustment coefficient, category prediction probability map, and binary label, and update the medical image segmentation model based on the category-level overlap loss.
[0065] Category-level overlap loss is used to represent the overall overlap between the predicted region and the real region of the medical image segmentation model for that computational category.
[0066] Specifically, for each computation category, the server calculates the category-level overlap loss using the category prediction probability map, binary labels, and adaptive adjustment coefficients for that category. The category prediction probability map describes the probability that the medical image segmentation model predicts each image element belongs to that computation category; the binary labels describe whether each image element actually belongs to that computation category; and the adaptive adjustment coefficients are used to change the role of the intersection term between the predicted and ground truth regions in the category-level overlap loss, thereby adjusting the optimization state of the category-level overlap loss based on the boundary complexity of the computation category and the area of the target region.
[0067] In some embodiments, the class-level overlap loss can be constructed based on the sum of squares of the class prediction probability maps, the sum of squares of the binary labels, and the intersection term of the class prediction probability maps and the binary labels. An adaptive adjustment coefficient is used to adjust the weight of the intersection term in the loss calculation. Here, the sum of squares of the class prediction probability maps represents the overall size of the predicted region, the sum of squares of the binary labels represents the overall size of the ground truth region, and the intersection term represents the degree of overlap between the predicted and ground truth regions. By changing the role of the intersection term through the adaptive adjustment coefficient, different optimized states of the class-level overlap loss can be obtained for computational categories with different boundary complexities and target region areas during training.
[0068] It should be noted that the local heterogeneity weights are not directly used as independent loss terms for each image element in the model parameter updates. The local heterogeneity weights of each boundary image element are first accumulated into a second boundary count, then combined with the first boundary count to form the boundary complexity, and finally the category-level overlap loss is adjusted by adaptive adjustment coefficients.
[0069] It should be noted that when there are multiple categories, the server calculates the category-level overlap loss for each category participating in the current training calculation, and then performs a category average to obtain the total loss for the current training process. For example, when there are three categories: liver, kidney, and spleen, the server calculates the category-level overlap loss for each of the three categories separately, and then takes the arithmetic average of the three category-level overlap losses to obtain the total loss for the current training process.
[0070] The server calculates the parameter gradients of the medical image segmentation model based on the total loss and updates the network parameters of the medical image segmentation model using the actual optimizer employed. The optimizer can employ stochastic gradient descent, momentum-driven stochastic gradient descent, Adam, or other optimization methods capable of updating network parameters based on the loss gradient.
[0071] By repeatedly executing steps 201 to 207 through multiple training batches, local boundary heterogeneity is gradually incorporated into the optimization of model parameters until the set number of training rounds or other training termination conditions are met, resulting in a fully trained medical image segmentation model.
[0072] Once the model is trained, inputting the medical image into the trained medical image segmentation model will generate the medical image segmentation result.
[0073] By implementing steps 201 to 207 above, and by acquiring medical images and determining the set of image elements and at least one computational category, the problem of inconsistent model input caused by the diverse formats and sizes of medical images is solved. This enables preprocessing of two-dimensional or three-dimensional, single-modal or multi-modal medical images and determination of a unified computational range. By determining the binary labels of computational categories in the set of image elements, the problem of difficulty in independently analyzing the boundaries for each computational category in multi-class segmentation tasks is solved. This enables the extraction of binary labels on a category-by-category basis, providing a foundation for category-by-category boundary analysis. By determining the boundary image elements based on the binary labels and a preset neighborhood template, and counting the first boundary, the system achieves the following: This approach addresses the problem that existing hard boundary counting methods can only reflect the number of boundary locations and cannot distinguish the composition of local neighborhoods. It achieves automatic identification of boundary image elements and acquisition of the overall boundary scale without requiring manual boundary annotation. By calculating a second boundary count based on the number of image elements belonging to the same calculation category as the boundary image elements within a preset neighborhood template, it solves the problem of hard counting being unable to distinguish between boundaries with the same number but different local contours. This provides a differentiated description of the heterogeneity of local neighborhoods at boundary locations and supplements the local morphological information missing from hard boundary counting. Finally, it obtains the boundary complexity by weighted summation of the first and second boundary counts, and then... An adaptive adjustment coefficient is generated based on the complexity and target region area, solving the problem of a single description of boundary complexity that cannot simultaneously consider boundary size, local heterogeneity, and target size. This ensures that the adaptive adjustment coefficient is influenced by boundary size, local neighborhood heterogeneity, and target region area. By inputting medical images into a medical image segmentation model to obtain a category prediction probability map, the problem of the model's prediction results and the true labels needing to correspond on the same set of image elements is solved. This achieves element-wise alignment between the category prediction probability map and the binary labels, providing prediction probabilities for calculating category-level overlap loss. The calculation is performed based on the adaptive adjustment coefficient, the category prediction probability map, and the binary labels. This approach employs a category-level overlap loss and updates the medical image segmentation model based on this loss. It addresses the limitations of traditional region-based losses in describing local boundary morphology and their inability to adaptively adjust the loss according to boundary complexity and target size. By implementing category-level loss adjustment based on local boundary heterogeneity, the model training can simultaneously consider target scale, boundary size, and local boundary morphology, avoiding the problem of different local contours receiving the same boundary description due to reliance on uniform hard counting. Furthermore, this approach is only implemented during the training phase, without altering the basic structure of the original medical image segmentation network or increasing computation during the inference phase. This allows for improved category-level boundary description discrimination capabilities while maintaining deployment efficiency.
[0074] In one exemplary embodiment, in order to determine boundary image elements, such as Figure 3 As shown, step 203 above is specifically replaced by steps 301 to 304: Step 301: Set the tag value of the first tag to 1 and the tag value of the second tag to 0.
[0075] The server sets the label value of the first label in the binary label to 1 and the label value of the second label to 0, thus converting the category assignment of the computational category into a binary mask composed of 0s and 1s. Here, the first label indicates that an image element in the image element set belongs to the computational category, and the second label indicates that an image element does not belong to the computational category. After this assignment, the label value of each image element in the binary label directly indicates whether the image element belongs to the computational category.
[0076] In some embodiments, when the true segmentation label corresponding to the original image is a multi-class label map, the server sets the image element whose true segmentation label value is equal to the class index of the calculated class to 1, and sets the image element whose true segmentation label value is not equal to the class index of the calculated class to 0.
[0077] In other embodiments, when the real segmentation label corresponding to the original image is itself a binary label for the computation category, the server directly obtains the binary label for the computation category from the image element set and sets the first label to 1 and the second label to 0.
[0078] It should be noted that setting the first label to 1 and the second label to 0 is only one specific value method in this embodiment. When the true segmentation label corresponding to the original image adopts other value methods, before performing subsequent neighborhood response calculation, the label values belonging to the calculation category and those not belonging to the calculation category are mapped to 1 and 0 respectively.
[0079] Step 302: Convolve the binary label with the preset neighborhood template and then multiply it element by element with the binary label to obtain the neighborhood response map of the binary label.
[0080] The neighborhood response map includes the neighborhood response value of each image element.
[0081] Specifically, let the current calculation category be... The binary label for this calculation category is The preset neighborhood template is Then the neighborhood response graph Determined according to the following formula: in, This represents the convolution operation. This indicates element-wise multiplication.
[0082] For image element set Each image element in Convolution result Represented by image elements The number of image elements belonging to this calculation category within the preset neighborhood of the center. When the preset neighborhood template is a 3×3 cross-shaped neighborhood template: therefore: in, , , and Representing image elements respectively The top, bottom, left, and right adjacent image elements.
[0083] Then, the convolution result is multiplied element-wise with the binary label to obtain the neighborhood response map: Right now: because The value can be either 0 or 1, therefore: when hour, ; when hour, That is, the number of image elements belonging to the calculation category in the image element itself and its four neighboring areas above, below, left, and right.
[0084] Therefore, neighborhood response graph Neighborhood response value of each image element The value range is 0 to 5. When When the value is specified, it indicates that the image element and its four neighbors (upper, lower, left, and right) all belong to this calculation category, and the image element is an internal image element of the target; when... When the value is in the range of a certain value, it indicates that there are image elements nearby that do not belong to the calculated category, and this image element is a candidate boundary image element; when ... When the value is zero, it indicates that the image element is not the target image element of the calculation category.
[0085] For image elements located at the edge of the image element set, the portion of the preset neighborhood template that extends beyond the image element set is processed according to a preset boundary processing method, ensuring that the resulting neighborhood response map maintains the same spatial size as the binary label. In two-dimensional medical images, the edge refers to the outermost ring of pixels, such as pixels in the first row, first column, last row, or last column; in three-dimensional medical images, the edge refers to the outermost voxels, such as the six surfaces. The preset boundary processing method can include zero-fill, i.e., setting the portion of the preset neighborhood template that extends beyond the image element set to 0, or copy-fill, i.e., copying the portion of the preset neighborhood template that extends beyond the image element set to the label value of the image element whose edge is closest to the extended portion.
[0086] Step 303: Set the neighborhood response value that is equal to the maximum neighborhood response value in the neighborhood response graph to 0 to obtain the boundary response graph.
[0087] Let the current calculation category be The neighborhood response graph is The maximum neighborhood response value is Then the boundary response diagram Determined according to the following formula: in, Represents image elements in the neighborhood response graph The neighborhood response value; Image elements in the boundary response graph The neighborhood response value.
[0088] Maximum neighborhood response value The neighborhood response value is determined based on a preset neighborhood template. When the preset neighborhood template is a 3×3 cross-shaped neighborhood template, this template includes the center position and four adjacent positions (top, bottom, left, and right), for a total of 5 positions participating in the counting. Therefore, the maximum neighborhood response value is determined. At this point, the boundary response diagram is determined according to the following formula: Since the non-target image elements have been set to 0 through element-wise multiplication, the boundary response map after this step... Non-zero positions in the calculation correspond to the boundary image elements of that calculation category. Target interior image elements with a neighborhood response value equal to 5 are set to 0 and no longer participate in subsequent boundary counting; candidate boundary image elements with a neighborhood response value less than 5 but greater than 0 retain their neighborhood response values as neighborhood response values.
[0089] The above operation can also be expressed as: in, This is an indicator function that takes the value 1 when the condition is true and 0 otherwise. This indicates element-wise multiplication. The expression represents multiplying the neighborhood response map. The median is equal to the maximum neighborhood response value. The position is set to 0, while the other positions remain unchanged.
[0090] In some embodiments, when the preset neighborhood template takes other forms, the maximum neighborhood response value This is equal to the total number of positions participating in the counting within the neighborhood template. For example, if the neighborhood template includes the center and eight adjacent positions, then the maximum neighborhood response value is... At this point, the neighborhood response values equal to 9 in the neighborhood response graph are set to 0, resulting in the boundary response graph.
[0091] Step 304: Determine the image elements in the boundary response map whose neighborhood response values are non-zero as boundary image elements.
[0092] Server traversal boundary response graph For each image element in the dataset, determine whether its neighborhood response value is zero. If the neighborhood response value is not zero, then the image element is identified as a boundary image element of that computational category. This yields the set of boundary image elements for that computational category.
[0093] Specifically, let the current calculation category be... Its boundary response diagram is Then the set of boundary image elements It can be represented as: in, Represents a set of image elements; Represents image elements; Image elements in the boundary response graph The neighborhood response value.
[0094] Since non-target image elements have been set to 0 through element-wise multiplication, and target interior image elements whose neighborhood response value equals the maximum neighborhood response value have also been set to 0, the non-zero image elements in the boundary response map after the above processing are the boundary image elements of this computational category. In other words, boundary image elements are those target image elements that belong to this computational category but are not considered target interior image elements.
[0095] In some embodiments, the boundary image element set Each image element in the image satisfies: in, This indicates that the image element belongs to this calculation category; This indicates that the image element is not an internal image element of the target, but a candidate image element for the boundary.
[0096] After the server determines the boundary image elements, it further counts the set of boundary image elements. The number of image elements in the image is used to obtain the first boundary count for this computation category. The first boundary count, also known as the hard boundary count, indicates how many boundary image elements the computation category has, preserving the overall size of the computation category's boundary. The formula is as follows: in, Indicates the first The first boundary count of the class is calculated; Indicates the first The boundary response map of the class is calculated; This indicates the number of non-zero elements in the input.
[0097] In some embodiments, if the boundary response map If the neighborhood response values of all image elements are zero, it indicates that the calculated category has no boundary image elements in the current image element set, and the first boundary count of the calculated category is zero. In practical applications, whether to continue to retain the calculated category, skip the calculated category, or use other missing category handling methods can be determined based on the actual training configuration.
[0098] In one exemplary embodiment, in order to calculate the second boundary count, such as Figure 4 As shown, step 204 above is specifically replaced by steps 401 to 402: Step 401: Based on the preset weight adjustment index and the neighborhood response value of the boundary image element, calculate the local heterogeneity weight of each boundary image element in the boundary response map.
[0099] Among them, the larger the neighborhood response value, the smaller the local heterogeneity weight.
[0100] Let the current calculation category be The boundary response diagram is as follows The maximum neighborhood response value is The preset weight adjustment index is For image elements in the boundary response map whose neighborhood response values are non-zero... That is, the local heterogeneity weights of the boundary image elements. Determined according to the following formula: in, Representing boundary image elements The neighborhood response value; This represents the maximum neighborhood response value determined based on the preset neighborhood template; This represents a preset weight adjustment index greater than 0, used to control the degree of weight difference between different neighborhood response values; Indicates an indicator function, when The value is 1 when the condition is met and 0 otherwise, which is used to ensure that local heterogeneity weights are calculated only for boundary image elements.
[0101] When the preset neighborhood template is a 3×3 cross-shaped neighborhood template, the maximum neighborhood response value is... At this point, the local heterogeneity weights are determined according to the following formula: From the above formula, we can see that the neighborhood response value The larger the value, the more image elements belonging to the same computational category surround the boundary image element, the more regular the local boundary, the weaker the local neighborhood heterogeneity, and therefore the smaller the calculated local heterogeneity weight; neighborhood response value The smaller the value, the fewer image elements belonging to the same computational category are around the boundary image element, the stronger the local neighborhood heterogeneity, and therefore the larger the calculated local heterogeneity weight.
[0102] In some embodiments, a preset weight adjustment index is used. The value is set to 1. Under this value, when the neighborhood response values are 4, 3, 2, and 1, the corresponding local heterogeneity weights are 0.25, 0.50, 0.75, and 1.00, respectively. It can be understood that the preset weight adjustment index... Alternatively, other values can be set according to the actual training configuration to control the degree of weight difference between different neighborhood response values. Preset weight adjustment index. It is used to adjust the local heterogeneity weight distribution and the degree of nonlinear change corresponding to different neighborhood response values.
[0103] Due to the neighborhood response values of the boundary image elements The value range is 1 to Therefore, local heterogeneity weights For boundary image elements, the value is greater than 0 and not greater than 1; for non-boundary image elements, the indicator function sets it to 0. Therefore, for all image elements, the overall range of local heterogeneity weights is 0 to 1. The local heterogeneity weight of each boundary image element is not greater than 1, thus ensuring that the second boundary count obtained by summing the local heterogeneity weights of all boundary image elements does not exceed the first boundary count.
[0104] Step 402: Sum the local heterogeneity weights of all boundary image elements to obtain the second boundary count.
[0105] Specifically, let the current calculation category be... Its boundary image element set is Each boundary image element The local heterogeneity weight is Then the second boundary count Determined according to the following formula: in, Boundary response diagram The set of image elements with non-zero response values in the middle neighborhood, i.e., the set of boundary image elements; Representing boundary image elements Local heterogeneity weights.
[0106] Since the local heterogeneity weight of non-boundary image elements is 0, the second boundary count can also be expressed as the weight of the image element set. The local heterogeneity weights of all image elements are summed: Second boundary counting, also known as soft boundary counting, differs from first boundary counting, which only counts the number of boundary image elements. Second boundary counting further differentiates each boundary image element based on its local neighborhood composition. While first boundary counting preserves the overall scale of the calculated category boundaries, second boundary counting supplements the local neighborhood differences between different boundary image elements.
[0107] In some embodiments, when the preset neighborhood template is a 3×3 cross-shaped neighborhood template and the preset weight adjustment index is 1, the local heterogeneity weights corresponding to the boundary image elements with neighborhood response values of 4, 3, 2, and 1 are 0.25, 0.50, 0.75, and 1.00, respectively. The server sums up the local heterogeneity weights of all boundary image elements to obtain the second boundary count for this calculation category.
[0108] For example, if a certain calculation category has 12 boundary image elements with a neighborhood response value of 4 and 4 boundary image elements with a neighborhood response value of 3, then the second boundary count is 12×0.25+4×0.50=5.0.
[0109] Since the local heterogeneity weight of each boundary image element is no greater than 1, the second boundary count does not exceed the first boundary count. in, This represents the first boundary count for this computational category. This relationship indicates that the second boundary count is still based on the already identified boundary image elements, only further altering the contribution of different boundary image elements to the category-level boundary complexity.
[0110] When there are multiple computation categories, the server performs the above accumulation operation on each computation category participating in the current training computation to obtain the second boundary count for each computation category.
[0111] In some embodiments, if the neighborhood response values of all image elements in the boundary response map are zero, it indicates that there are no boundary image elements for that computational category in the current set of image elements, and the second boundary count for that computational category is zero. Whether to retain the computational category item, skip it, or use other missing category handling methods in practical applications can be determined based on the actual training configuration.
[0112] In one exemplary embodiment, in order to generate adaptive adjustment coefficients, such as Figure 5 As shown, step 205 above is specifically replaced by steps 501 to 503: Step 501: Calculate the ratio of boundary complexity to the area of the target region.
[0113] Specifically, let the current calculation category be... The boundary complexity of this computational category is The target area for this calculation category is Then, the server calculates the ratio of boundary complexity to the area of the target region.
[0114] In some embodiments, the ratio is determined according to the following formula: in, This represents a smoothing constant greater than 0, used to avoid the denominator being zero when the area of the target region is zero, and to improve the stability of numerical calculations.
[0115] In other embodiments, when the area of the target region is not zero, this ratio can also be directly expressed as: The larger the ratio of boundary complexity to target area, the higher the boundary complexity of the computational category relative to its target area; the smaller the ratio, the lower the boundary complexity of the computational category relative to its target area.
[0116] When there are multiple computation categories, the server calculates the ratio of the boundary complexity to the area of the target region for each computation category participating in the current training computation.
[0117] Step 502: Determine the initial adjustment coefficient based on the ratio.
[0118] Specifically, let the current calculation category be... The ratio of boundary complexity to the area of the target region is The server then bases its decisions on this ratio. Determine the initial adjustment coefficient for this calculation category. .
[0119] In some embodiments, the initial adjustment coefficient is determined according to the following formula: in, This represents the ratio of boundary complexity to the area of the target region; the constant 2 represents a fixed scaling factor for the boundary complexity ratio in this adaptive relationship.
[0120] From the above formula, we can see that the initial adjustment coefficient and ratio Negative correlation: ratio The larger the initial adjustment coefficient, the higher the initial adjustment coefficient. The smaller; the ratio The smaller the initial adjustment coefficient The larger the initial adjustment coefficient, the lower the boundary complexity of the computational category relative to the area of the target region. In other words, the lower the initial adjustment coefficient, the higher the boundary complexity of the computational category relative to the area of the target region.
[0121] For example, when the ratio When the ratio is 0.1, the initial adjustment coefficient is 0.8; when the ratio is... When the ratio is 0.2, the initial adjustment coefficient is 0.6; when the ratio is... When the ratio is 0.5, the initial adjustment coefficient is 0; when the ratio is... When the value is greater than 0.5, the initial adjustment coefficient is negative. It's understandable that the fixed scaling factor can also be set to other values based on the actual training configuration, as long as the negative correlation between the larger the ratio and the smaller the initial adjustment coefficient is maintained.
[0122] When there are multiple computation categories, the server performs the above operation on each computation category participating in the current training computation to obtain the initial adjustment coefficient for each computation category.
[0123] Step 503: Compare the initial adjustment coefficient with the preset adaptive adjustment threshold, and determine the smaller of the initial adjustment coefficient and the preset adaptive adjustment threshold as the adaptive adjustment coefficient.
[0124] Specifically, let the current calculation category be... The initial adjustment coefficient is The preset adaptive adjustment threshold is The server will then apply the initial adjustment coefficient. With preset adaptive adjustment threshold The two are compared, and the smaller one is determined as the adaptive adjustment coefficient for that calculation category. .
[0125] In some embodiments, the adaptive adjustment coefficient is determined according to the following formula: in, Indicates the initial adjustment coefficient; This indicates a preset adaptive adjustment threshold; This means taking the smaller of the two input values; This represents the adaptive adjustment coefficient for the final determined calculation category.
[0126] From the above formula, we can see that: When the initial adjustment coefficient Less than the preset adaptive adjustment threshold When, adaptive adjustment coefficient equal to the initial adjustment coefficient When the initial adjustment coefficient Greater than or equal to the preset adaptive adjustment threshold When, adaptive adjustment coefficient Equal to the preset adaptive adjustment threshold .
[0127] In other words, the preset adaptive adjustment threshold is used to set an upper limit on the adaptive adjustment coefficient, preventing it from becoming too large. In the current implementation, the preset adaptive adjustment threshold... The value is 0.8.
[0128] It should be noted that the current calculation formula only sets an upper limit for the adaptive adjustment coefficient, without setting an additional lower limit. Therefore, when the ratio of boundary complexity to the target region area is high, the initial adjustment coefficient may take a negative value. In this case, since the negative value is less than the preset adaptive adjustment threshold of 0.8, the adaptive adjustment coefficient will take this negative value. That is to say, the adaptive adjustment coefficient can take a negative value, and this application does not make any additional truncation for this. If other numerical truncation methods are used in practical applications, they can be determined according to the actual training configuration.
[0129] When there are multiple computation categories, the server performs the above comparison and value taking operations on each computation category participating in the current training computation to obtain the adaptive adjustment coefficient for each computation category.
[0130] In one exemplary embodiment, in order to calculate the category-level overlap loss, such as Figure 6 As shown, step 207 above is specifically replaced by steps 601 to 605: Step 601: Determine the sum of squared predicted probabilities of the category prediction probability map based on the category prediction probability map.
[0131] Specifically, let the current calculation category be... The category prediction probability map for this calculation category is as follows: The set of image elements is The server then predicts the probability map based on the category. Determine the sum of squared predicted probabilities for this calculation category.
[0132] In some embodiments, the sum of squared predicted probabilities is determined according to the following formula: in, This represents the sum of squared predicted probabilities for this calculation category; Image elements representing category prediction probability maps The predicted probability, that is, the probability that the medical image segmentation model predicts that the image element belongs to the calculated category; Represents a set of image elements Summing all image elements in the image.
[0133] As shown in the above formula, the sum of squared predicted probabilities is the sum of the squares of the predicted probabilities of each image element in the category prediction probability map. This sum of squared predicted probabilities represents the overall size of the predicted region for that computational category obtained by the medical image segmentation model. The larger the sum of squared predicted probabilities, the more image elements the model predicts that the computational category occupies in the image element set, or the higher the predicted probability; the smaller the sum of squared predicted probabilities, the fewer image elements the model predicts that the computational category occupies in the image element set, or the lower the predicted probability.
[0134] Step 602: Determine the number of first labels in the binary labels based on the binary labels.
[0135] Specifically, let the current calculation category be... The binary label for this calculation category is The set of image elements is If the first tag has a value of 1 and the second tag has a value of 0, then the server counts the binary tags. The number of image elements with a value of 1 is used to obtain the number of first labels for that calculation category.
[0136] In some embodiments, the number of first tags is determined according to the following formula: in, This indicates the number of the first label in the calculated category; Represents image elements in binary labels The tag value.
[0137] Since the first tag is 1 and the second tag is 0, therefore It can take the value 0 or 1. When When the image element belongs to the calculation category, it is counted in the first label count; when If the image element does not belong to the calculation category, it is not included in the first label count. Therefore, the first label count represents the total number of image elements in the binary labels that belong to the calculation category.
[0138] In some embodiments, since the first label is 1 and its square is still 1, and the second label is 0 and its square is still 0, the number of the first label can also be expressed as the sum of the squares of the binary labels: The number of first labels is used to represent the overall size of the real region for this calculation category, and can be consistent with the area of the target region. When the area of the target region for this calculation category has already been counted, this step can directly use the target region area as the number of first labels, or it can be obtained by recounting the number of first labels in the binary labels.
[0139] If all image elements in the binary label have the second label value, meaning that the calculated category does not exist in the current set of image elements, then the number of first labels is zero. In this case, the true region size of the calculated category is zero. In practical applications, whether to continue to retain the calculated category, skip the calculated category, or use other missing category handling methods can be determined based on the actual training configuration.
[0140] Step 603: Determine the intersection of the category prediction probability map and the binary labels based on the category prediction probability map and the binary labels.
[0141] Specifically, let the current calculation category be... The category prediction probability map for this calculation category is as follows: The binary label for this calculation category is The set of image elements is Then the server predicts the probability map based on the category. and binary labels Determine the intersection of the calculation categories.
[0142] In some embodiments, the intersection items are determined according to the following formula: in, This represents the intersection of the calculation categories.
[0143] From the above formula, we can see that the intersection term is the sum of the products of the predicted probability of the category prediction map and the binary label on the same image element, and the label value of the binary label. Since the first label in the binary label is 1 and the second label is 0, therefore: When image elements When it belongs to this calculation category, The predicted probability of this image element Include the intersection term; when image elements When it does not belong to this calculation category, The predicted probability of the image element is not included in the intersection term.
[0144] Therefore, the intersection term represents the sum of the predicted probabilities that the medical image segmentation model predicts an image element belonging to that computational category at the actual location of the image element. A larger intersection term indicates a higher degree of overlap between the region predicted by the model for that computational category and the actual region; a smaller intersection term indicates a lower degree of overlap between the region predicted by the model for that computational category and the actual region.
[0145] In some embodiments, when the area of the target region for the calculation category has been statistically analyzed, since the area of the target region is the number of first labels in the binary labels, and the intersection term is the sum of the predicted probabilities at the positions of the first labels, the intersection term and the area of the target region are related. When the prediction probability of the medical image segmentation model at all target positions is 1, the intersection term equals the area of the target region; when the prediction probability of the medical image segmentation model at some target positions is less than 1, the intersection term is less than the area of the target region.
[0146] In some embodiments, if the label values of all image elements in the binary label are the second label, meaning that the calculated category does not exist in the current set of image elements, then the intersection term is zero. In this case, the category-level overlap loss term of the calculated category may degenerate into a state that does not provide a direct category-specific gradient. When using multi-class normalized probability output, the error response corresponding to the calculated category can still be indirectly constrained through multi-class probability competition. In practical applications, whether to continue to retain the calculated category term, skip the calculated category term, or use other missing category handling methods can be determined according to the actual training configuration.
[0147] Step 604: Adjust the intersection terms according to the adaptive adjustment coefficient to obtain the adjusted intersection terms.
[0148] Specifically, let the current calculation category be... The adaptive adjustment coefficient for this calculation category is The intersection of this calculation category is The server then adjusts the coefficients adaptively. For intersection terms Adjustments are made to obtain the adjusted intersection terms for this calculation category.
[0149] In some embodiments, the adjusted intersection terms are determined according to the following formula: in, This represents the intersection term after category adjustment in the calculation; This represents the adjustment factor used to adjust the intersection terms.
[0150] From the above formula, we can see that the adaptive adjustment coefficient Through regulating factors Change the role of the intersection term in the category-level overlap loss: When the adaptive adjustment coefficient When the value is 0, the adjustment factor is 1, and the adjusted intersection terms are equal to the original intersection terms, that is, the intersection terms do not change; When the adaptive adjustment coefficient When the value is greater than 0, the adjustment factor is greater than 1, and the adjusted intersection term is greater than the original intersection term, indicating that the adaptive adjustment coefficient enhances the role of the intersection term in loss calculation; When the adaptive adjustment coefficient When the value is less than 0, the adjustment factor is less than 1, and the adjusted intersection term is less than the original intersection term, indicating that the adaptive adjustment coefficient weakens the role of the intersection term in loss calculation.
[0151] Due to the adaptive adjustment coefficient The adjusted intersection term is also affected by the boundary size, local neighborhood heterogeneity, and target region area. Computational categories with the same number of boundaries but different local neighborhood shapes can generate different adaptive adjustment coefficients, resulting in different adjusted intersection terms. Similarly, computational categories with the same boundary complexity but different target region areas can also obtain different adaptive adjustment coefficients, leading to different adjusted intersection terms.
[0152] In some embodiments, when an adaptive adjustment coefficient has already been generated based on the boundary complexity and the target region area, this step can directly use the adaptive adjustment coefficient to adjust the intersection term. In other embodiments, when the adaptive adjustment coefficient is determined based on the initial adjustment coefficient and a preset adaptive adjustment threshold, this step can use the finally determined adaptive adjustment coefficient to adjust the intersection term.
[0153] Step 605: Calculate the category-level overlap loss of the computational category based on the sum of squared predicted probabilities, the number of first labels, the adjusted intersection terms, and the preset smoothing constant.
[0154] Specifically, let the current calculation category be... The sum of squared predicted probabilities for this category is: The number of the first label in this calculation category is The intersection of this calculation category is The adjusted intersection term of this calculation category is The preset smoothing constant is The server then calculates the category-level overlap loss for that calculation category based on the parameters mentioned above. .
[0155] In some embodiments, the category-level overlap loss is determined according to the following formula: From the above formula, we can see that: The numerator is the sum of squared predicted probabilities plus the number of first labels, minus twice the original intersection term, plus a preset smoothing constant; the denominator is the sum of squared predicted probabilities plus the number of first labels, minus the adjusted intersection term, plus a preset smoothing constant; dividing the numerator by the denominator yields the category-level overlap loss for that calculation category.
[0156] This category-level overlap loss is used to represent the overall overlap between the predicted region and the real region of the calculated category by the medical image segmentation model. The closer the category prediction probability map is to the binary label, the larger the intersection term, the smaller the difference between the numerator and denominator, and the smaller the category-level overlap loss. Conversely, the greater the difference between the category prediction probability map and the binary label, the smaller the intersection term, the greater the difference between the numerator and denominator, and the greater the category-level overlap loss.
[0157] Adaptive adjustment coefficient Through the adjusted intersection terms This affects the denominator, thus altering the role of the intersection term in the class-level overlap loss. Since the adaptive adjustment coefficient is influenced by boundary size, local neighborhood heterogeneity, and the target region area, different calculated classes can yield different adjusted intersection terms, resulting in different class-level overlap losses. It should be noted that this step only adjusts the intersection term; the sum of squared predicted probabilities and the number of first labels do not change with the adaptive adjustment coefficient.
[0158] In some embodiments, a preset smoothing constant is used. The specific value can be determined based on the actual training configuration, as long as it is greater than 0.
[0159] When there are multiple computation categories, the category-level overlap loss is obtained for all computation categories participating in the current training computation, and then the category average is performed to obtain the total loss. The medical image segmentation model is then updated based on this total loss.
[0160] In some embodiments, total loss Determined according to the following formula: After obtaining the total loss, the server calculates the parameter gradients of the medical image segmentation model based on this total loss, and updates the network parameters of the medical image segmentation model using the actual optimizer employed. The optimizer can employ stochastic gradient descent, momentum-based stochastic gradient descent, Adam, or other optimization methods capable of updating network parameters based on the loss gradient. The parameter update process can be represented as: in, This represents the set of trainable parameters for a medical image segmentation model. This indicates the gradient-based model optimizer used in the actual training. This represents the total loss with respect to the model parameters. The gradient.
[0161] By repeatedly executing the above steps in multiple training batches, local boundary heterogeneity is gradually incorporated into the optimization of model parameters until the set number of training rounds or other training termination conditions are met, resulting in a fully trained medical image segmentation model.
[0162] After model training is complete, the inference phase no longer reads the true segmentation labels, nor does it calculate binary labels, neighborhood response maps, boundary response maps, first boundary counts, second boundary counts, boundary complexity, adaptive adjustment coefficients, or training loss. During the inference phase, the medical image is simply input into the trained medical image segmentation model to generate the medical image segmentation result.
[0163] In other words, local neighborhood response, internal position suppression, first boundary count, second boundary count, boundary complexity, and the corresponding class-level overlap loss are all performed during the model training phase. These calculations directly use existing pixel-level or voxel-level segmentation labels for medical images, without requiring the creation of additional independent boundary labels or the addition of a separate boundary prediction branch to the existing medical image segmentation network. The boundary analysis and class-level overlap loss calculations are no longer performed during the inference phase. Therefore, this application changes the training objective and parameter acquisition process of the medical image segmentation model, without requiring the model to employ a specific encoder, decoder, or skip connection structure.
[0164] It should be noted that when the medical image is a three-dimensional image, the method of this application can still be followed, only requiring the definition of the corresponding three-dimensional neighborhood template, the maximum neighborhood response value, and the normalization relationship.
[0165] In one exemplary embodiment, such as Figure 7 As shown, the binary label image represents a regular target. In a 9×9 image element set, the central 5×5 black area is the first label, indicating that the image element belongs to the computation category; the remaining white areas are the second labels, indicating that the image element does not belong to the computation category. The target area is 25.
[0166] A 3×3 cross-shaped neighborhood template is used to convolve the binary label and multiply it element-wise with the binary label to obtain the neighborhood response map. The internal image elements in the neighborhood response map that have the largest neighborhood response value of 5 are set to 0 to obtain the boundary response map. This binary label map yields 12 boundary image elements with a neighborhood response value of 4 and 4 boundary image elements with a neighborhood response value of 3. Therefore, the first boundary count is 12 + 4 = 16.
[0167] With a preset weight adjustment index of 1.0, the local heterogeneity weight corresponding to the boundary image element with a neighborhood response value of 4 is 0.25, and the local heterogeneity weight corresponding to the boundary image element with a neighborhood response value of 3 is 0.50. Adding the local heterogeneity weights of all boundary image elements, the second boundary count is 12 × 0.25 + 4 × 0.50 = 5.0. Taking the second weight as 0.4 and the first weight as 0.6, the boundary complexity is 0.6 × 16 + 0.4 × 5.0 = 11.6. An adaptive adjustment coefficient is generated based on the boundary complexity and the target region area. Ignoring the influence of the smoothing constant, the adaptive adjustment coefficient is 1 - 2 × (11.6 / 25) = 0.072.
[0168] In contrast, such as Figure 8 As shown, the binary label image represents an irregular target. Its target area is also 25, and its first boundary count is also 16, but the local neighborhood composition of the boundary image elements differs. This binary label image yields 10 boundary image elements with a neighborhood response value of 4, 4 boundary image elements with a neighborhood response value of 3, and 2 boundary image elements with a neighborhood response value of 2. Similarly, taking a preset weight adjustment index of 1.0, the local heterogeneity weights corresponding to neighborhood response values of 4, 3, and 2 are 0.25, 0.50, and 0.75, respectively. Figure 8 The second boundary count of the binary label map shown is 10 × 0.25 + 4 × 0.50 + 2 × 0.75 = 6.0. Taking the second weight as 0.4 and the first weight as 0.6, the boundary complexity is 0.6 × 16 + 0.4 × 6.0 = 12.0. Ignoring the effect of the smoothing constant, the adaptive adjustment coefficient is 1 - 2 × (12.0 / 25) = 0.040.
[0169] Furthermore, assuming that the medical image segmentation model is effective... Figure 7 and Figure 8 The 25 target image elements in the two binary label maps all output a prediction probability of 0.8, and the remaining 56 non-target image elements all output 0.1. Therefore, for these two binary label maps, the sum of squared prediction probabilities of the category prediction probability maps is 16.56.
[0170] Since the binary labels are 0 or 1, the number of first labels in both binary label graphs is 25. Therefore, the intersection of the category prediction probability graph and the binary label graph is 20.
[0171] for Figure 7 The binary label map shown has an adaptive adjustment coefficient of 0.072, and the adjusted intersection term is 21.44. Substituting the above parameters into the category-level overlap loss calculation formula, taking the preset smoothing constant ε as a minimum value and ignoring its influence, then... Figure 7 The category-level overlap loss of the binary label map shown is approximately 0.0775.
[0172] for Figure 8 The binary label map shown has an adaptive adjustment coefficient of 0.040 and an adjusted intersection term of 20.80. Therefore, the category-level overlap loss of this binary label map is approximately 0.0751.
[0173] As can be seen, the target regions of the two binary label images have the same area and the same first boundary count. The medical image segmentation model also outputs the same category prediction probability for the two regions. However, due to the different local boundary shapes and second boundary counts of the two regions, the boundary complexity is different, the adaptive adjustment coefficient is different, and the final category-level overlap loss is also different. Figure 7 The category-level overlap loss of the binary label map shown is approximately 0.0775. Figure 8 The category-level overlap loss of the binary label map shown is approximately 0.0751, indicating a difference between the two. This difference demonstrates that this application can differentiate the category-level overlap loss based on local boundary morphology differences even when the target region area, first boundary count, and model prediction conditions are the same. This allows for the differentiation of computational categories with different local boundary heterogeneity during model training, improving the medical image segmentation model's ability to distinguish local boundary morphology differences. It should be noted that increased boundary complexity does not necessarily mean a monotonically increasing category-level overlap loss; boundary complexity is not directly added to the loss as an additional penalty, but rather its role in the category-level overlap loss is adjusted by changing the adaptive adjustment coefficient to control the intersection of the predicted and ground regions.
[0174] It should be noted that the above values are merely illustrative examples for demonstration purposes. Figure 7 The binary label image shown and Figure 8 The binary label maps shown can still yield different second boundary counts, boundary complexities, adaptive adjustment coefficients, and class-level overlap losses even when the target region area, first boundary count, and prediction probability are all the same. In actual training, the specific loss values will vary with model parameters, prediction probabilities, and training configurations, and this application is not limited to these.
[0175] This application also provides an application scenario in which the above-mentioned medical image segmentation model training method is applied. Specifically, the medical image segmentation model training method provided in this embodiment can be applied to the segmentation model training stage in a medical imaging AI-assisted diagnostic system. For example, in a liver tumor segmentation task, it is necessary to train a model that can automatically delineate tumor regions from abdominal CT or MRI images. The training data consists of a large number of medical images with pixel-level segmentation labels, where each pixel is labeled as either background or tumor. In actual clinical practice, the morphology of tumors varies greatly among different patients; some have smooth and regular boundaries, while others have spurs, depressions, turns, or adhesion to surrounding tissues. When using traditional region-based loss training, if two tumors have the same target area and number of boundary pixels, but one has a regular boundary and the other has an irregular boundary, existing hard boundary counting methods can only count the number of boundary pixels and cannot distinguish the differences in the composition of their local neighborhoods. Therefore, they may obtain the same boundary complexity and adjustment coefficient, resulting in the model being unable to perform differentiated optimization for local boundary morphological differences, and the segmentation accuracy for irregular boundaries is insufficient.
[0176] The method in this application directly utilizes existing pixel-level segmentation labels during the training phase. A binary label is determined for each computational category, and boundary image elements are identified based on the binary label and a preset neighborhood template. A first boundary count is then calculated. Simultaneously, a second boundary count is calculated based on the number of image elements belonging to the same computational category as the boundary image element within the preset neighborhood template. This second boundary count reflects the local neighborhood heterogeneity around the boundary image elements, allowing tumors with the same number of boundary image elements but different local morphologies to obtain different second boundary counts. The first and second boundary counts are weighted and summed to obtain the boundary complexity, which is then combined with the tumor region area to generate an adaptive adjustment coefficient. This coefficient is used to adjust the category-level overlap loss. Thus, for tumors with the same target area and number of boundary pixels but different local boundary morphologies, the medical image segmentation model can obtain different boundary complexities and adaptive adjustment coefficients. This allows for differentiated optimization of regions with strong local boundary heterogeneity during training, improving the medical image segmentation model's ability to distinguish irregular tumor boundaries and its segmentation accuracy.
[0177] After training, this medical image segmentation model can be deployed in hospital image archiving and communication systems or AI-assisted diagnostic platforms. During inference, ground truth labels are no longer needed, nor are local neighborhood responses, boundary counts, and training losses calculated. Simply input the patient's CT or MRI images into the trained segmentation network, and the tumor segmentation results will be output. Doctors can then use these results for target delineation, volume measurement, surgical planning, or radiotherapy planning. Since boundary analysis and loss calculation are performed only during the training phase, without increasing the computational burden during inference or requiring changes to the original segmentation network structure, this method can serve as an independent training strategy, adaptable to different medical image segmentation networks, and beneficial for improving the accuracy and robustness of boundary segmentation in tasks such as liver tumors, gliomas, lung nodules, and multi-organ segmentation.
[0178] Based on the same inventive concept, this application also provides a medical image segmentation model training apparatus for implementing the medical image segmentation model training method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more embodiments of the medical image segmentation model training apparatus provided below can be found in the limitations of the medical image segmentation model training method described above, and will not be repeated here.
[0179] In one exemplary embodiment, a medical image segmentation model training apparatus is provided, such as... Figure 9 As shown, the device includes: Image acquisition module 701 is used to acquire medical images and determine the set of image elements and at least one computational category of the medical images; The label determination module 702 is used to determine the binary label of the calculation category in the image element set. The binary label includes a first label and a second label, wherein the first label indicates that the image element in the image element set belongs to the calculation category; and the second label indicates that the image element does not belong to the calculation category. The first counting module 703 is used to determine the image elements that belong to the calculation category and have a second label in the preset neighborhood template as boundary image elements of the calculation category based on the binary label and the preset neighborhood template, and count the number of boundary image elements to obtain the first boundary count of the calculation category. The second counting module 704 is used to calculate the second boundary count of the calculation category based on the number of image elements belonging to the same calculation category as the boundary image elements within a preset neighborhood template. The coefficient generation module 705 is used to obtain the boundary complexity of the calculation category by weighted summation of the first boundary count and the second boundary count, and to generate an adaptive adjustment coefficient based on the boundary complexity and the target region area of the calculation category; wherein, the target region area is the number of first labels in the binary labels; The probability acquisition module 706 is used to input medical images into the medical image segmentation model to obtain a category prediction probability map for calculating the category. The loss update module 707 is used to calculate the category-level overlap loss based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, and to update the medical image segmentation model based on the category-level overlap loss.
[0180] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0181] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 10 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores training data for a medical image segmentation model. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a method for training a medical image segmentation model.
[0182] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0183] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0184] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0185] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.
[0186] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).
[0187] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0188] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0189] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. In summary, the content of this specification should not be construed as a limitation of this application.
Claims
1. A method for training a medical image segmentation model, characterized in that, The training method for the medical image segmentation model includes: Acquire medical images and determine the set of image elements and at least one computational category of the medical images; A binary label for the computation category is determined in the set of image elements. The binary label includes a first label and a second label, wherein the first label indicates that the image element in the set of image elements belongs to the computation category; and the second label indicates that the image element does not belong to the computation category. Based on the binary label and the preset neighborhood template, image elements that belong to the calculation category and have the second label in the preset neighborhood template are determined as boundary image elements of the calculation category, and the number of the boundary image elements is counted to obtain the first boundary count of the calculation category. The second boundary count of the calculation category is calculated based on the number of image elements belonging to the same calculation category as the boundary image element within the preset neighborhood template; The boundary complexity of the computation category is obtained by weighted summation of the first boundary count and the second boundary count. An adaptive adjustment coefficient is generated based on the boundary complexity and the target region area of the computation category. The target region area is the number of the first labels in the binary labels. The medical image is input into the medical image segmentation model to obtain the category prediction probability map of the calculated category; The category-level overlap loss of the calculated category is calculated based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, and the medical image segmentation model is updated based on the category-level overlap loss.
2. The medical image segmentation model training method according to claim 1, characterized in that, When there are multiple computational categories, the step of calculating the category-level overlap loss of the computational categories based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label, and updating the medical image segmentation model based on the category-level overlap loss, further includes: The category-level overlap loss for each of the computed categories is calculated based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label. The total loss is obtained by taking the arithmetic mean of the category-level overlap losses of all the calculated categories; The medical image segmentation model is updated based on the total loss.
3. The medical image segmentation model training method according to claim 1 or 2, characterized in that, The step of determining image elements belonging to the calculation category and containing the second label within the preset neighborhood template as boundary image elements of the calculation category based on the binary label and preset neighborhood template specifically includes: Set the tag value of the first tag to 1, and set the tag value of the second tag to 0; The binary label is convolved with the preset neighborhood template and then multiplied element-wise with the binary label to obtain the neighborhood response map of the binary label, wherein the neighborhood response map includes the neighborhood response value of each image element. The neighborhood response value equal to the maximum neighborhood response value in the neighborhood response graph is set to 0 to obtain the boundary response graph; wherein, the maximum neighborhood response value is determined according to the preset neighborhood template; The image elements whose neighborhood response values are non-zero in the boundary response map are identified as the boundary image elements.
4. The medical image segmentation model training method according to claim 3, characterized in that, The calculation of the second boundary count of the calculation category based on the number of image elements belonging to the same calculation category as the boundary image element within the preset neighborhood template specifically includes: Based on a preset weight adjustment index and the neighborhood response value of the boundary image element, the local heterogeneity weight of each boundary image element in the boundary response map is calculated, wherein the larger the neighborhood response value, the smaller the local heterogeneity weight. The local heterogeneity weights of all the boundary image elements are summed to obtain the second boundary count.
5. The medical image segmentation model training method according to claim 1 or 2, characterized in that, The process of generating adaptive adjustment coefficients based on the boundary complexity and the target region area of the computation category specifically includes: Calculate the ratio of the boundary complexity to the area of the target region; An initial adjustment coefficient is determined based on the ratio, wherein the larger the ratio, the smaller the initial adjustment coefficient; The initial adjustment coefficient is compared with the preset adaptive adjustment threshold, and the smaller of the initial adjustment coefficient and the preset adaptive adjustment threshold is determined as the adaptive adjustment coefficient.
6. The medical image segmentation model training method according to claim 1 or 2, characterized in that, The calculation of the category-level overlap loss of the calculated category based on the adaptive adjustment coefficient, the category prediction probability map, and the binary label specifically includes: Based on the category prediction probability map, determine the sum of squared prediction probabilities of the category prediction probability map, wherein the sum of squared prediction probabilities is the sum of the squares of the prediction probabilities of each image element in the category prediction probability map; Based on the binary labels, determine the number of the first labels in the binary labels; Based on the category prediction probability map and the binary label, determine the intersection of the category prediction probability map and the binary label, wherein the intersection is the sum of the products of the prediction probability of the category prediction probability map and the binary label on the same image element and the label value of the binary label; The intersection terms are adjusted according to the adaptive adjustment coefficient to obtain the adjusted intersection terms; The category-level overlap loss of the computational category is calculated based on the sum of squared predicted probabilities, the number of the first labels, the adjusted intersection term, and a preset smoothing constant.
7. A medical image segmentation model training device, characterized in that, The medical image segmentation model training device includes: The image acquisition module is used to acquire medical images and determine the set of image elements and at least one computational category of the medical images; A label determination module is used to determine a binary label for the computation category in the image element set. The binary label includes a first label and a second label, wherein the first label indicates that the image element in the image element set belongs to the computation category; and the second label indicates that the image element does not belong to the computation category. The first counting module is used to determine the image elements that belong to the calculation category and have the second label in the preset neighborhood template as the boundary image elements of the calculation category based on the binary label and the preset neighborhood template, and count the number of the boundary image elements to obtain the first boundary count of the calculation category. The second counting module is used to calculate the second boundary count of the calculation category based on the number of image elements in the preset neighborhood template that belong to the same calculation category as the boundary image element. The coefficient generation module is used to obtain the boundary complexity of the computation category by weighted summation of the first boundary count and the second boundary count, and to generate an adaptive adjustment coefficient based on the boundary complexity and the target region area of the computation category; wherein, the target region area is the number of the first labels in the binary labels; The probability acquisition module is used to input the medical image into the medical image segmentation model to obtain the category prediction probability map of the calculated category; The loss update module is used to calculate the category-level overlap loss of the calculated category based on the adaptive adjustment coefficient, the category prediction probability map and the binary label, and update the medical image segmentation model based on the category-level overlap loss.
8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the steps of the medical image segmentation model training method according to any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the medical image segmentation model training method according to any one of claims 1-6.
10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the steps of the medical image segmentation model training method according to any one of claims 1-6.
