A training method, device, equipment and storage medium for an image segmentation model
By constructing the segmentation loss function of the edge mapping matrix, category loss matrix and distance correlation matrix, and adjusting the image segmentation model parameters, the complex network architecture is solved, and the model performance is improved without increasing training time.
Patent Information
- Application Number
- CN202310630051.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2043-05-30
AI Technical Summary
The network architecture of traditional image segmentation models is too complex, resulting in increased computational costs in the training and application stages.
By determining the edge mapping matrix, category loss matrix and distance correlation matrix, a segmentation loss function is constructed, and the model parameters of the initial image segmentation model are adjusted based on this function until the segmentation loss function converges, and the target image segmentation model that has been trained is obtained.
Without significantly increasing the training time, the edge relationship and category relationship of segmented image points in the image segmentation model are optimized, and the model performance is improved.
Smart Images

Figure CN116758284B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of artificial intelligence, and particularly to a training method, device, equipment and storage medium for an image segmentation model. Background Art
[0002] Image segmentation refers to a technique of dividing an image into several non-overlapping regions according to features such as gray scale, color, spatial texture, geometric shape, etc., so that these features show consistency or similarity within the same region, and show obvious differences between different regions.
[0003] With the continuous development of artificial intelligence technology, neural network models have begun to be applied to image segmentation. In order to improve the model performance of the trained image segmentation model, the current main research direction is to improve the network architecture of the image segmentation model, resulting in an overly complex network architecture of the image segmentation model, increasing the computational cost of the image segmentation model in the training stage and the application stage. Summary of the Invention
[0004] Embodiments of the present invention provide a training method, device, equipment and storage medium for an image segmentation model, to solve the problem that the network architecture of the traditional image segmentation model is too complex, and improve the model performance of the trained image segmentation model without significantly increasing the training duration of the image segmentation model.
[0005] According to an embodiment of the present invention, a training method for an image segmentation model is provided, and the method includes:
[0006] Inputting a training image into an initial image segmentation model that has not been trained yet to obtain an output predicted segmentation image and predicted class data;
[0007] Based on the predicted segmentation image, predicted class data, standard segmentation image and standard class data, determining an edge mapping matrix, a class loss matrix and a distance association matrix;
[0008] Based on the edge mapping matrix, class loss matrix and distance association matrix, determining a segmentation loss function;
[0009] Based on the segmentation loss function, adjusting the model parameters of the initial image segmentation model until the segmentation loss function converges, to obtain a trained target image segmentation model;
[0010] Among them, the edge mapping matrix characterizes the accuracy probability of each segmented image point pair in the predicted segmented image relative to the standard segmented image, the class loss matrix characterizes whether the predicted class mapping of each segmented image point pair in the predicted segmented image is the same as the standard class mapping, and the distance correlation matrix characterizes the correlation probability of each segmented image point pair in the predicted segmented image.
[0011] According to another embodiment of the present invention, there is provided a training device for an image segmentation model, the device comprising:
[0012] A predicted segmented image output module, configured to input a training image into an initial image segmentation model that has not been trained yet, and obtain an output predicted segmented image and predicted class data;
[0013] An edge mapping matrix determination module, configured to determine an edge mapping matrix, a class loss matrix, and a distance correlation matrix based on the predicted segmented image, the predicted class data, the standard segmented image, and the standard class data;
[0014] A segmentation loss function determination module, configured to determine a segmentation loss function based on the edge mapping matrix, the class loss matrix, and the distance correlation matrix;
[0015] A target image segmentation model determination module, configured to adjust the model parameters of the initial image segmentation model based on the segmentation loss function until the segmentation loss function converges, and obtain a trained target image segmentation model;
[0016] Among them, the edge mapping matrix characterizes the accuracy probability of each segmented image point pair in the predicted segmented image relative to the standard segmented image, the class loss matrix characterizes whether the predicted class mapping of each segmented image point pair in the predicted segmented image is the same as the standard class mapping, and the distance correlation matrix characterizes the correlation probability of each segmented image point pair in the predicted segmented image.
[0017] According to another embodiment of the present invention, there is provided an electronic device, the electronic device comprising:
[0018] At least one processor; and
[0019] A memory communicatively connected to the at least one processor; wherein,
[0020] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the image segmentation model according to any embodiment of the present invention.
[0021] According to another embodiment of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the training method of the image segmentation model according to any embodiment of the present invention when executed.
[0022] The technical solution of the embodiment of the present invention determines an edge mapping matrix, a class loss matrix, and a distance association matrix based on a standard segmentation image, standard category data, a predicted segmentation image output by an initial image segmentation model, and predicted category data. Based on the edge mapping matrix, the class loss matrix, and the distance association matrix, a segmentation loss function is determined. Based on the segmentation loss function, the model parameters of the initial image segmentation model are adjusted until the segmentation loss function converges, and a trained target image segmentation model is obtained. This solves the problem that the network architecture of the traditional image segmentation model is too complex, and realizes optimizing the edge relationship and class relationship of the segmentation image points in the segmentation image from the level of the loss function, and improves the model performance of the trained image segmentation model without significantly increasing the training duration of the image segmentation model.
[0023] It should be understood that the content described in this part is not intended to identify the key or important features of the embodiments of the present invention, nor is it used to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention, and those of ordinary skill in the art can obtain other drawings without creative efforts based on these drawings.
[0025] Figure 1 It is a flowchart of a method for training an image segmentation model provided by an embodiment of the present invention;
[0026] Figure 2 It is a flowchart of another method for training an image segmentation model provided by an embodiment of the present invention;
[0027] Figure 3 It is a network architecture diagram of a ToothNet model provided by an embodiment of the present invention;
[0028] Figure 4 It is a network architecture diagram of an initial image segmentation network provided by an embodiment of the present invention;
[0029] Figure 5 It is a structural schematic diagram of a training device for an image segmentation model provided by an embodiment of the present invention;
[0030] Figure 6 A structural schematic diagram of an electronic device provided by an embodiment of the present invention. Specific embodiments
[0031] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0032] It should be noted that the terms "first", "second", "initial", "target", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily need to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so that the embodiments of the present invention described here can be implemented in an order other than those illustrated or described here. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0033] Figure 1 A flowchart of a method for training an image segmentation model provided by an embodiment of the present invention. This embodiment is applicable to the situation of training an image segmentation model. This method can be executed by a training device for an image segmentation model. The training device for the image segmentation model can be implemented in the form of hardware and / or software, and the training device for the image segmentation model can be configured in a terminal device. As Figure 1 shown, the method includes:
[0034] S110. Input a training image into an initial image segmentation model that has not been trained yet, and obtain a predicted segmentation image and predicted class data as output.
[0035] Among them, by way of example, the image type of the training image can be a medical image, an environmental image, an item image, a person image, etc. The acquisition devices for medical images include but are not limited to ultrasound devices, magnetic resonance devices, CBCT (Cone beam CT) devices, infrared devices, etc. The segmentation objects in medical images include but are not limited to teeth, blood vessels, lesions, etc. The image type of the training image is not limited here.
[0036] Among them, by way of example, the model architecture of the initial image segmentation model includes, but is not limited to, image segmentation networks such as the SegNet network, the DeepLab network, the FCN (Fully Convolutional Networks), the U-Net network, and the ToothNet model. Here, the model architecture of the initial image segmentation model is not limited.
[0037] Among them, specifically, the predicted segmentation image is used to represent the predicted segmentation result corresponding to the training image. The predicted segmentation image includes a background region and edge contour regions corresponding to at least one segmentation object respectively. The predicted category data is used to represent the predicted category corresponding to each image point in the predicted segmentation image. In an alternative embodiment, when the training image is a three-dimensional image, the image point represents a voxel point, and when the training image is a two-dimensional image, the image point represents a pixel point.
[0038] S120. Determine an edge mapping matrix, a category loss matrix, and a distance correlation matrix based on the predicted segmentation image, the predicted category data, the standard segmentation image, and the standard category data.
[0039] In this embodiment, the edge mapping matrix represents the accuracy probability of each pair of segmentation image points in the predicted segmentation image relative to the standard segmentation image. The category loss matrix represents whether the predicted category mapping of each pair of segmentation image points in the predicted segmentation image is the same as the standard category mapping. The distance correlation matrix represents the correlation probability of each pair of segmentation image points in the predicted segmentation image.
[0040] Among them, specifically, the segmentation image point is used to represent the image point on each edge contour region in the predicted segmentation image. By way of example, the set of predicted image points composed of each segmentation image point is represented by P s The m-th segmentation image point is represented by p m P s ={p1, p2, …, p M}, p m ∈P s , where M represents the total number of segmentation image points in the predicted segmentation image. Correspondingly, the standard image point is used to represent the image point on each edge contour region in the standard segmentation image. The set of standard image points composed of each standard image point is represented by Q s The u-th standard image point is represented by q u Q s ={q1, q2, …, q U}, q u ∈Q s , where U represents the total number of standard image points in the standard segmentation image.
[0041] In this example, the edge mapping matrix, the class loss matrix, and the distance association matrix are all M×M-dimensional matrices. In the embodiments of the present invention, the training image is a three-dimensional image, and the segmentation image point pairs are used to segment the image point p m and the segmentation image point p n are used for exemplary illustration. Other segmentation image point pairs are the same or similar to the segmentation image point p m and the segmentation image point p n , where m,n∈[1,M].
[0042] As an alternative embodiment, based on the predicted segmentation image, the predicted class data, the standard segmentation image, and the standard class data, determining the edge mapping matrix, the class loss matrix, and the distance association matrix includes: obtaining the predicted segmentation coordinates corresponding to each segmentation image point in the predicted segmentation image, and obtaining the predicted object class corresponding to each segmentation image point from the predicted class data; determining the edge mapping matrix based on each predicted segmentation coordinate and the standard segmentation image; determining the class loss matrix based on each predicted object class and the standard class data; determining the distance association matrix based on a preset distance threshold and each predicted segmentation coordinate.
[0043] Among them, by way of example, the predicted segmentation coordinates of the segmentation image point p m are (x m ,y m ,z m ), the predicted object class is p(x m ,y m ,z m ), the image point corresponding to the segmentation image point p m in the standard segmentation image is q m , and the standard object class corresponding to the image point q m in the standard class data is q(x m ,y m ,z m ).
[0044] As an alternative embodiment, based on each predicted segmentation coordinate and the standard segmentation image, determining the edge mapping matrix includes: for each segmentation image point in the predicted segmentation image, determining whether the predicted segmentation coordinate corresponding to the segmentation image point exists in the set of standard image points corresponding to the standard segmentation image; if so, setting the predicted accuracy corresponding to the segmentation image point to a first value; if not, setting the predicted accuracy corresponding to the segmentation image point to 0; for each pair of segmentation image points in the predicted segmentation image, determining an accuracy probability based on the two predicted accuracies corresponding to the pair of segmentation image points, and setting the value of the edge matrix parameter corresponding to the pair of segmentation image points in the edge mapping matrix to the accuracy probability.
[0045] Exemplarily, the first value may be 1 or 0.9, and the specific value of the first value is not limited here.
[0046] For example, the first value is 1, and the segmentation image point p m The prediction accuracy E(x m ,y m ,z m ) satisfies the formula:
[0047]
[0048] Specifically, if E(x m ,y m ,z m )=1, it means the segmentation image point p in the predicted segmentation image m is the edge contour point of the segmented object, the segmentation result is accurate. If E(x m ,y m ,z m )=0, it means the segmentation image point p in the predicted segmentation image m It is not an edge contour point of the segmented object and the segmentation result is wrong.
[0049] Specifically, the accuracy probability represents the mean accuracy corresponding to the two prediction accuracies. For example, the edge mapping matrix PE(p m ,p n ) satisfies the formula:
[0050]
[0051] Among them, p m ,p n ∈P s ,m,n∈[1,M]. When PE(p m ,p n )=1, the segmented image point p m and segmentation image point p n are all edge contour points of the segmented object; when PE(p m ,p n )=0.5, the segmented image point p m and segmentation image point p n Only one of them is the edge contour point of the segmented object; when PE(p m ,p n )=0, the segmentation image point p m and segmentation image point p n None of them are edge contour points of the segmented object.
[0052] As an alternative embodiment, based on each predicted object category and the standard category data, a category loss matrix is determined, including: for each pair of segmentation image points in the predicted segmentation image, based on the two predicted object categories corresponding to the pair of segmentation image points, a predicted category mapping is determined; the two standard object categories corresponding to the pair of segmentation image points are obtained from the standard category data, and based on the two standard object categories, a standard category mapping is determined; when the predicted category mapping is the same as the standard category mapping, the category matrix parameter value corresponding to the pair of segmentation image points in the category loss matrix is set to a second value; when the predicted category mapping is different from the standard category mapping, the category matrix parameter value corresponding to the pair of segmentation image points in the category loss matrix is set to 0.
[0053] Specifically, the predicted category mapping represents the category mapping of the predicted object category of the segmentation image point p m relative to the predicted object category of the segmentation image point p n , and the standard category mapping represents the category mapping of the standard object category of the segmentation image point p m relative to the standard object category of the segmentation image point p n .
[0054] As an alternative embodiment, the product results and difference results respectively corresponding to the two predicted object categories are obtained, and the sum of the product result and the difference result is used as the predicted category mapping of the pair of segmentation image points; the product results and difference results respectively corresponding to the two standard object categories are obtained, and the sum of the product result and the difference result is used as the standard category mapping of the pair of segmentation image points. Exemplarily, the predicted category mapping PC(p m , p n ) and the standard category mapping PC(q m , q n ) satisfy the formula:
[0055] PC(p m , p n ) = p(x m , y m , z m ) * p(x n , y n , z n ) + p(x m , y m , z m ) - p(x n , y n , z n ),
[0056] PC(q m , q n ) = q(x m , y m , z m)*q(x n ,y n ,z n )+q(x m ,y m ,z m )-q(x n ,y n ,z n ).
[0057] Among them, exemplarily, the second value can be 1 or 0.9, and the specific value of the second value is not limited herein.
[0058] For example, when the second value is 1, the class loss matrix L c (p m ,q m ) satisfies the formula:
[0059]
[0060] Among them, specifically, when L c (p m ,q m ) = 0, it indicates that the class mapping of the segmentation image point p m to the segmentation image point p n is correct. When L c (p m ,q m ) = 1, it indicates that the class mapping of the segmentation image point p m to the segmentation image point p n is incorrect.
[0061] As an alternative embodiment, based on a preset distance threshold and each predicted segmentation coordinate, a distance correlation matrix is determined, including: based on the two predicted segmentation coordinates corresponding to a pair of segmentation image points, an image point distance is determined, and it is determined whether the image point distance is less than the preset distance threshold and not zero; if so, based on the image point distance, a correlation probability is determined, and the distance matrix parameter value corresponding to the pair of segmentation image points in the distance correlation matrix is set to the correlation probability; if not, the distance matrix parameter value corresponding to the pair of segmentation image points in the distance correlation matrix is set to 0
[0062] As an alternative embodiment, exemplarily, the image point distance D(p m ,p n ) satisfies the formula:
[0063]
[0064] As another alternative embodiment, determining the image point distance based on two predicted segmentation coordinates corresponding to a pair of segmented image points includes: when the training image is a three-dimensional medical image, determining the image point distance based on the image slice thickness and the two predicted segmentation coordinates corresponding to the pair of segmented image points.
[0065] Wherein, by way of example, the image point distance D(p m , p n ) satisfies the formula:
[0066]
[0067] Where k > 1, and k represents a coefficient that is positively correlated with the image slice thickness.
[0068] The advantage of such a setting is that it takes into account the spatial correlation between the current segmented image point and other segmented image points in its z direction. By increasing the influence weight of the distance difference in the z direction on the image point distance, the accuracy of the image point distance in characterizing the spatial correlation between two segmented image points is improved.
[0069] Wherein, by way of example, the distance correlation matrix PD(p m , p n ) satisfies the formula:
[0070]
[0071] Where T represents a preset distance threshold. Specifically, the closer the image point distance between the segmented image point p m and the segmented image point p n , the stronger the spatial correlation between the two. Conversely, the farther the image point distance between the segmented image point p m and the segmented image point p n , the weaker the spatial correlation between the two, or even uncorrelated. When the image point distance between the segmented image point p m and the segmented image point p n is 0, it means that the segmented image point p m and the segmented image point p n are the same segmented image point, and in this embodiment, the class mapping of each segmented image point to itself is not calculated.
[0072] S130. Determine the segmentation loss function based on the edge mapping matrix, the class loss matrix, and the distance correlation matrix.
[0073] In this example, the edge mapping matrix, the class loss matrix, and the distance correlation matrix are represented by PE, L c and PD respectively.
[0074] As an alternative embodiment, determining a segmentation loss function based on an edge mapping matrix, a class loss matrix, and a distance association matrix includes: for each pair of segmentation image points in a predicted segmentation image, obtaining an edge matrix parameter value and a distance matrix parameter value corresponding to the pair of segmentation image points in the edge mapping matrix and the distance association matrix respectively; setting a fusion matrix parameter value corresponding to the pair of segmentation image points in the edge distance matrix as a product result of the edge matrix parameter value and the distance matrix parameter value; and determining the segmentation loss function based on the edge distance matrix and the class loss matrix.
[0075] In this example, for a segmentation image point p m and a segmentation image point p n , the corresponding edge matrix parameter value is PE(p m , p n ), the distance matrix parameter value is PD(p m , p n ). Exemplarily, the fusion matrix parameter value ED(p m , p n ) satisfies the formula:
[0076] ED(p m , p n ) = PE(p m , p n ) * PD(p m , p n )
[0077] In this embodiment, when ED(p m , p n ) = 0, there may be three cases: 1) the accuracy probability of the segmentation image point p m and the segmentation image point p n is 0; 2) the image point distance between the segmentation image point p m and the segmentation image point p n is greater than a preset distance threshold T; 3) the segmentation image point p m and the segmentation image point p n belong to the same segmentation image point. For the above three cases, the loss function values are not considered in the embodiments of the present invention.
[0078] As an alternative embodiment, determining a segmentation loss function based on an edge distance matrix and a class loss matrix includes: for each pair of segmentation image points in a predicted segmentation image, obtaining a fusion matrix parameter value and a class matrix parameter value corresponding to the pair of segmentation image points in the edge distance matrix and the class loss matrix respectively; determining a geometric matrix parameter value corresponding to the pair of segmentation image points based on the fusion matrix parameter value and the class matrix parameter value; determining a geometric loss function based on the geometric matrix parameter values respectively corresponding to each pair of segmentation image points, and determining the segmentation loss function based on the geometric loss function.
[0079] In this example, the segmented image point p m and segmentation image point p n The corresponding category matrix parameter value is L c (p m ,q m ), exemplarily, the geometric matrix parameter value GD(p m ,p n ) satisfies the formula:
[0080] GD(p m ,p n )=L c (p m ,p n )*ED(p m ,p n )
[0081] Geometric loss function L ed Satisfy the formula:
[0082]
[0083] Among them, N ED Indicates the number of parameters in the edge distance matrix ED whose fusion matrix parameter values are greater than 0.
[0084] As an optional embodiment, determining the segmentation loss function based on the geometric loss function includes: using the geometric loss function as the segmentation loss function. Wherein, exemplarily, the segmentation loss function L=L ed .
[0085] As another optional embodiment, the predicted category data includes predicted binary categories corresponding to at least one edge contour area in the predicted segmented image, and correspondingly, the standard category data includes standard binary categories corresponding to at least one edge contour area in the standard segmented image, and the segmentation loss function is determined based on the geometric loss function, including: determining the cross entropy loss function based on the predicted category data and the standard category data, and determining the segmentation loss function based on the cross entropy loss function and the geometric loss function.
[0086] Among them, exemplary, the cross entropy loss function is the softmax cross entropy loss function, and the segmentation loss function L=L pi +L ed , where L pi represents the cross loss function.
[0087] As another optional embodiment, determining the segmentation loss function based on the geometric loss function includes: obtaining a basic loss function corresponding to the initial image segmentation model, and determining the segmentation loss function based on the basic loss function and the geometric loss function.
[0088] Among them, specifically, the basic loss function represents the preset loss function adopted by the initial image segmentation model. Exemplarily, the segmentation loss function L = L base +L ed , where L base represents the basic loss function.
[0089] As another alternative embodiment, based on the geometric loss function, determining the segmentation loss function includes: obtaining the basic loss function corresponding to the initial image segmentation model, and determining the cross-entropy loss function based on the predicted category data and the standard category data; determining the segmentation loss function based on the basic loss function, the cross-entropy loss function, and the geometric loss function.
[0090] Among them, exemplarily, the segmentation loss function L = L base +L pi +L ed .
[0091] The advantage of such a setting is that the geometric loss function provided by the embodiments of the present invention can be mounted on the basic loss function of any image segmentation model, and is applicable to the image segmentation model with any model architecture. While improving the model performance of the image segmentation model, the scalability of the embodiments of the present invention is improved.
[0092] S140. Based on the segmentation loss function, adjust the model parameters of the initial image segmentation model until the segmentation loss function converges, and obtain the trained target image segmentation model.
[0093] The technical solution of this embodiment determines the edge mapping matrix, the category loss matrix, and the distance association matrix based on the standard segmentation image, the standard category data, the predicted segmentation image output by the initial image segmentation model, and the predicted category data. Based on the edge mapping matrix, the category loss matrix, and the distance association matrix, determine the segmentation loss function. Based on the segmentation loss function, adjust the model parameters of the initial image segmentation model until the segmentation loss function converges, and obtain the trained target image segmentation model, solving the problem that the network architecture of the traditional image segmentation model is too complex, and realizing the optimization of the edge relationship and category relationship of the segmentation image points in the segmentation image from the level of the loss function, and improving the model performance of the trained image segmentation model without significantly increasing the training duration of the image segmentation model.
[0094] Figure 2 This is a flowchart of another method for training an image segmentation model provided by an embodiment of the present invention. In this embodiment, the network architecture of the image segmentation model is further refined. In this embodiment, the network architecture of the image segmentation model adopts the image segmentation network in the ToothNet model. AsFigure 2 As shown in the figure, the method includes:
[0095] S210. Input the training image into the initial image segmentation network in the ToothNet model that has not been trained yet, and obtain the output predicted segmentation image and predicted class data.
[0096] Figure 3 The figure is a network architecture diagram of a ToothNet model provided by an embodiment of the present invention. Specifically, the ToothNet model is a network model for tooth instance segmentation of dental CBCT images, and its core is a two-stage network architecture. In the first stage, an edge detection network (corresponding to the upper left box in the figure) extracts an edge map from the input dental CBCT image to enhance the contrast along the shape boundary of the dental CBCT image, and then transfers the tooth edge map output by the edge detection network and the input dental CBCT image to the second stage. Figure 3 In the second stage, the image segmentation network of the ToothNet model (corresponding to the right stepped box in the figure) constructs a new learning similarity matrix in the three-dimensional region to help effectively eliminate redundancy, accelerate training, and save GPU memory. To solve the ambiguity in the recognition task, the ToothNet model also encodes the tooth spatial relationship as an additional feature input in the recognition task to significantly improve the recognition accuracy of the ToothNet model.
[0097] In the first stage, since the blurred signals in the CBCT image make it difficult to distinguish the tooth boundaries, and at the same time, the low contrast value between different teeth also hinders the accurate segmentation of teeth. To solve the above problems, the ToothNet model trains an edge detection network separately to extract the edge map to enhance the boundary information. As shown in the figure, the edge detection network consists of an encoder with nine convolutional layers and three decoder branches, and these decoders are connected to the low-level, middle-level, and high-level features from the encoder. The loss function of the edge detection network uses the mean square error (MSE) loss function. Exemplarily, the mean square error loss function is defined as: Figure 3 In the formula, E represents the real edge image, and E' represents the predicted edge image output by different decoders.
[0098] In the first stage, since the blurred signals in the CBCT image make it difficult to distinguish the tooth boundaries, and at the same time, the low contrast value between different teeth also hinders the accurate segmentation of teeth. To solve the above problems, the ToothNet model trains an edge detection network separately to extract the edge map to enhance the boundary information. As shown in the figure, the edge detection network consists of an encoder with nine convolutional layers and three decoder branches, and these decoders are connected to the low-level, middle-level, and high-level features from the encoder. The loss function of the edge detection network uses the mean square error (MSE) loss function. Exemplarily, the mean square error loss function is defined as: Figure 3 As shown in the figure, the edge detection network consists of an encoder with nine convolutional layers and three decoder branches, and these decoders are connected to the low-level, middle-level, and high-level features from the encoder. The loss function of the edge detection network uses the mean square error (MSE) loss function. Exemplarily, the mean square error loss function is defined as:
[0099]
[0100] where E represents the real edge image, and E' represents the predicted edge image output by different decoders. i ' represents the predicted edge image output by different decoders.
[0101] In the second stage, the ToothNet model uses three convolutional layers on the last decoder of the edge detection network and the dental CBCT images respectively, then cascades these two convolutional networks, and takes the output result of the cascaded network as the input of the 3D Region Proposal Network (RPN) module. Among them, the 3D Region Proposal Network module is used to generate a set of candidate boxes and remove duplicate candidate boxes before the 3D Region Of Interest (ROI) calibration module. The similarity matrix is used to eliminate the redundancy of the candidate boxes output by the 3D Region Proposal Network module using shape features.
[0102] To train the predicted similarity matrix S, first, obtain the top-k candidate boxes generated by the 3D Region Proposal Network module, denoted as P = {P0, P1, …, P k}. The dimension of the predicted similarity matrix S is k×k, and S ij represents the probability that the candidate box P i and the candidate box P j contain the same teeth. In the training stage, for any pair of candidate boxes P i and the candidate box P j in P, extract their corresponding image features F Pi and the image F Pj respectively in the cascaded network, then concatenate the two image features and send them to the fully connected layers (FC) to output the binary classification probability, which is supervised by the corresponding ground-truth similarity matrix S G .
[0103] The calculation of the ground-truth similarity matrix S G can be divided into two steps: First, assume that there are m ground-truth bounding boxes in the current patch, denoted as B = {B0, B1, …, B m}. Assume that the candidate box P i ∈P. First, calculate the IoU (Intersection over Union) score between the candidate box P i and the bounding box B c . The one with the highest score indicates that the candidate box P i and the bounding box B c are the most matched, that is, the probability of having the same teeth is the highest. Then, satisfy three rules to calculate value: 1) If {P i , P j} contains the same target index, and and values are both higher than the threshold η, then 2) If {P i , P j} contains different target indices, and and the values of both are higher than the threshold η, then if and the values of both are not higher than the threshold η, then Exemplarily, the threshold η can be set to 0.2. After obtaining the true similarity matrix S G , the classification loss function corresponding to the similarity matrix satisfies the formula:
[0104]
[0105] where, (i, j) ∈ ε means that (i, j) satisfies
[0106] In the application stage, the similarity matrix S is used as a lookup table, that is, for any pair of candidate boxes {P i , P j}, if S ij > 0.5, then discard the candidate box with a lower classification score. The method based on the similarity matrix can effectively remove the duplicate candidate boxes output by the 3D candidate box module, and further use the selected candidate boxes for detection, segmentation and recognition.
[0107] If two adjacent teeth have similar shapes, regardless of the spatial relationship, the general classifier will confuse these two teeth. To solve this problem, the ToothNet model encodes the spatial boxes and shape features of adjacent teeth as additional features for the recognition task. Specifically, after the 3D ROI calibration module, given the candidate box P i (P i ∈ {P0, P1, …, P n}, n is equal to the number of ROIs), first obtain the shape feature encoding of the candidate box P i , then consider the adjacent spatial relationship, and construct the spatial relationship component as the weighted sum of the shape feature encodings of all other candidate boxes. The relationship weight represents the influence from other candidate boxes. The recognition branch in the ToothNet model takes the shape feature encoding and the spatial relationship component as inputs and uses the SoftMax function to calculate the corresponding loss.
[0108] Among them, exemplarily, the basic loss function L base corresponding to the image segmentation network in the ToothNet model satisfies the formula:
[0109] L base = L cls + L box + L seg + Lid +κL SM
[0110] where κ = 0.5, L cls and L box respectively represent the classification loss function and the regression loss function in the 3D detection task, and L seg represents the segmentation loss function of the 3D segmentation task, and L id represents the recognition loss function of the 3D recognition task, and L SM represents the classification loss function corresponding to the predicted similarity matrix and the true similarity matrix output by the 3D candidate box module.
[0111] Figure 4 This is the network architecture diagram of an initial image segmentation network provided by an embodiment of the present invention. Specifically, Figure 4 the shown initial image segmentation network deletes the network structures related to edge detection in the ToothNet model, that is, the edge detection network in the ToothNet model and the convolutional network connecting the output of the edge detection network.
[0112] S220. Based on the predicted segmentation image, the predicted category data, the standard segmentation image, and the standard category data, determine the edge mapping matrix, the category loss matrix, and the distance association moment.
[0113] S230. Based on the edge mapping matrix, the category loss matrix, and the distance association matrix, determine the segmentation loss function.
[0114] S240. Based on the segmentation loss function, adjust the model parameters of the initial image segmentation network until the segmentation loss function converges, and obtain the trained target image segmentation network.
[0115] S220 - S240 in the embodiment of the present invention is the same or similar to Figure 1 S120 - S140 therein, and will not be elaborated here.
[0116] The ToothNet model needs to train a separate edge detection network to optimize the edge information of the image segmentation network, which consumes additional video memory, resulting in redundant network architecture and increasing the time of image segmentation. The technical solution of this embodiment optimizes the basic loss function of the image segmentation model through the local geometric loss function, optimizes the edge relationship and category relationship between different spatial surface points at the level of the loss function, effectively improves the edge information and category information of the predicted points on the tooth surface, and does not increase the online test time of the image segmentation model.
[0117] Based on the above embodiments, optionally, the method further includes: inputting the image to be segmented into a pre-trained target image segmentation model to obtain the output target segmentation image and target category data.
[0118] The following are embodiments of an apparatus for training an image segmentation model provided by embodiments of the present invention. This apparatus and the method for training an image segmentation model in the above embodiments belong to the same inventive concept. For details not described in detail in the embodiments of the apparatus for training an image segmentation model, reference may be made to the content of the method for training an image segmentation model in the above embodiments.
[0119] Figure 5 The following is a schematic structural diagram of an apparatus for training an image segmentation model provided by an embodiment of the present invention. As Figure 5 shown, the apparatus includes: a predicted segmentation image output module 310, an edge mapping matrix determination module 320, a segmentation loss function determination module 330, and a target image segmentation model determination module 340.
[0120] Among them, the predicted segmentation image output module 310 is configured to input a training image into an initial image segmentation model that has not been trained yet, and obtain the output predicted segmentation image and predicted category data;
[0121] The edge mapping matrix determination module 320 is configured to determine an edge mapping matrix, a category loss matrix, and a distance association matrix based on the predicted segmentation image, the predicted category data, the standard segmentation image, and the standard category data;
[0122] The segmentation loss function determination module 330 is configured to determine a segmentation loss function based on the edge mapping matrix, the category loss matrix, and the distance association matrix;
[0123] The target image segmentation model determination module 340 is configured to adjust the model parameters of the initial image segmentation model based on the segmentation loss function until the segmentation loss function converges, and obtain a trained target image segmentation model;
[0124] Among them, the edge mapping matrix represents the accuracy probability of each segmentation image point pair in the predicted segmentation image relative to the standard segmentation image, the category loss matrix represents whether the predicted category mapping of each segmentation image point pair in the predicted segmentation image is the same as the standard category mapping, and the distance association matrix represents the association probability of each segmentation image point pair in the predicted segmentation image.
[0125] The technical solution of this embodiment determines an edge mapping matrix, a class loss matrix, and a distance association matrix based on a standard segmentation image, standard class data, a predicted segmentation image output by an initial image segmentation model, and predicted class data. Based on the edge mapping matrix, the class loss matrix, and the distance association matrix, a segmentation loss function is determined. Based on the segmentation loss function, the model parameters of the initial image segmentation model are adjusted until the segmentation loss function converges, and a trained target image segmentation model is obtained, solving the problem that the network architecture of the traditional image segmentation model is too complex, and realizing the optimization of the edge relationship and class relationship of the segmentation image points in the segmentation image from the level of the loss function, and improving the model performance of the trained image segmentation model without significantly increasing the training duration of the image segmentation model.
[0126] As an optional embodiment, the edge mapping matrix determination module 320 includes:
[0127] A predicted segmentation coordinate acquisition unit, configured to acquire the predicted segmentation coordinates corresponding to each segmentation image point in the predicted segmentation image, and acquire the predicted object class corresponding to each segmentation image point from the predicted class data;
[0128] An edge mapping matrix determination unit, configured to determine an edge mapping matrix based on each predicted segmentation coordinate and the standard segmentation image;
[0129] A class loss matrix determination unit, configured to determine a class loss matrix based on each predicted object class and the standard class data;
[0130] A distance association matrix determination unit, configured to determine a distance association matrix based on a preset distance threshold and each predicted segmentation coordinate.
[0131] As an optional embodiment, the edge mapping matrix determination unit is specifically configured to:
[0132] For each segmentation image point in the predicted segmentation image, determine whether the predicted segmentation coordinate corresponding to the segmentation image point exists in the set of standard image points corresponding to the standard segmentation image;
[0133] If so, set the predicted accuracy corresponding to the segmentation image point to a first value;
[0134] If not, set the predicted accuracy corresponding to the segmentation image point to 0;
[0135] For each pair of segmentation image points in the predicted segmentation image, determine an accuracy probability based on the two predicted accuracies corresponding to the pair of segmentation image points, and set the edge matrix parameter value corresponding to the pair of segmentation image points in the edge mapping matrix to the accuracy probability.
[0136] As an alternative embodiment, the class loss matrix determination unit is specifically configured to:
[0137] For each pair of segmented image points in the predicted segmented image, based on the two predicted object classes corresponding to the pair of segmented image points, determine a predicted class mapping;
[0138] Obtain the two standard object classes corresponding to the pair of segmented image points from the standard class data, and based on the two standard object classes, determine a standard class mapping;
[0139] When the predicted class mapping is the same as the standard class mapping, set the class matrix parameter value corresponding to the pair of segmented image points in the class loss matrix to a second value;
[0140] When the predicted class mapping is different from the standard class mapping, set the class matrix parameter value corresponding to the pair of segmented image points in the class loss matrix to 0.
[0141] As an alternative embodiment, the distance association matrix determination unit is specifically configured to:
[0142] For each pair of segmented image points in the predicted segmented image, based on the two predicted segmentation coordinates corresponding to the pair of segmented image points, determine an image point distance, and determine whether the image point distance is less than a preset distance threshold and is not 0;
[0143] If so, based on the image point distance, determine an association probability, and set the distance matrix parameter value corresponding to the pair of segmented image points in the distance association matrix to the association probability;
[0144] If not, set the distance matrix parameter value corresponding to the pair of segmented image points in the distance association matrix to 0.
[0145] As an alternative embodiment, the segmentation loss function determination module 330 includes:
[0146] An edge matrix parameter value acquisition unit, configured to, for each pair of segmented image points in the predicted segmented image, acquire the edge matrix parameter value and the distance matrix parameter value corresponding to the pair of segmented image points in the edge mapping matrix and the distance association matrix respectively;
[0147] An edge distance matrix determination unit, configured to set the fusion matrix parameter value corresponding to the pair of segmented image points in the edge distance matrix to the product result of the edge matrix parameter value and the distance matrix parameter value;
[0148] A segmentation loss function determination unit, configured to determine a segmentation loss function based on the edge distance matrix and the class loss matrix.
[0149] As an alternative embodiment, the segmentation loss function determination unit is specifically configured to:
[0150] For each pair of segmented image points in the predicted segmented image, obtain the fusion matrix parameter value and the class matrix parameter value corresponding to the pair of segmented image points in the edge distance matrix and the class loss matrix respectively;
[0151] Based on the fusion matrix parameter value and the class matrix parameter value, determine the geometric matrix parameter value corresponding to the pair of segmented image points;
[0152] Based on the geometric matrix parameter values respectively corresponding to each pair of segmented image points, determine a geometric loss function, and based on the geometric loss function, determine a segmentation loss function.
[0153] The training device of the image segmentation model provided by the embodiments of the present invention can execute the training method of the image segmentation model provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the method.
[0154] Figure 6 It is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. The electronic device 10 is intended to represent various forms of digital computers, such as, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as, personal digital processors, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0155] As Figure 6 shown, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc. Among them, the memory stores a computer program executable by the at least one processor, and the processor 11 can execute various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. The input / output (I / O) interface 15 is also connected to the bus 14.
[0156] Multiple components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disc, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0157] The processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the training method of the image segmentation model provided in the above embodiments.
[0158] In some embodiments, the training method of the image segmentation model provided in the above embodiments can be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps in the training method of the image segmentation model described above can be executed. Alternatively, in other embodiments, the processor 11 can be configured to execute the training method of the image segmentation model in any other suitable way (e.g., by means of firmware).
[0159] The various embodiments of the systems and technologies described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-chip (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special or general programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit the data and instructions to the storage system, the at least one input device, and the at least one output device.
[0160] A computer program for implementing the method of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowchart and / or block diagram are implemented. The computer program can be executed entirely on the machine, partially on the machine, as a stand-alone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0161] In the context of the present invention, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, the computer-readable storage medium can be a machine-readable signal medium. More specific examples of the machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0162] In order to provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which the user can provide input to the electronic device. Other kinds of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0163] The systems and techniques described herein can be implemented in a computing system including backend components (e.g., as a data server), or a computing system including middleware components (e.g., an application server), or a computing system including frontend components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described herein), or a computing system including any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected with each other by digital data communication in any form or medium (e.g., a communication network). Examples of communication networks include: local area network (LAN), wide area network (WAN), blockchain network, and the Internet.
[0164] A computing system can include a client and a server. The client and the server are generally remote from each other and typically interact through a communication network. The client-server relationship is created by computer programs running on respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or a cloud host, which is a host product in the cloud computing service system, solving the defects of difficult management and weak business scalability existing in traditional physical hosts and VPS services.
[0165] It should be understood that various forms of the processes shown above can be used, with steps reordered, added, or deleted. For example, the steps recited in the present invention can be executed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved, and no limitation is made herein.
[0166] The above specific embodiments do not constitute a limitation on the protection scope of the present invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.
Claims
1. A training method for an image segmentation model, characterized in that, Including: Inputting a training image into an initial image segmentation model that has not been fully trained to obtain an output predicted segmentation image and predicted class data; Determining an edge mapping matrix, a class loss matrix, and a distance correlation matrix based on the predicted segmentation image, the predicted class data, the standard segmentation image, and the standard class data; Determining a segmentation loss function based on the edge mapping matrix, the class loss matrix, and the distance correlation matrix; Adjusting the model parameters of the initial image segmentation model based on the segmentation loss function until the segmentation loss function converges, and obtaining a trained target image segmentation model; Wherein, the edge mapping matrix characterizes the accuracy probability of each segmentation image point pair in the predicted segmentation image relative to the standard segmentation image, the class loss matrix characterizes whether the predicted class mapping of each segmentation image point pair in the predicted segmentation image is the same as the standard class mapping, and the distance correlation matrix characterizes the correlation probability of each segmentation image point pair in the predicted segmentation image; The determining the edge mapping matrix, the class loss matrix, and the distance correlation matrix based on the predicted segmentation image, the predicted class data, the standard segmentation image, and the standard class data includes: Obtaining the predicted segmentation coordinates corresponding to each segmentation image point in the predicted segmentation image, and obtaining the predicted object class corresponding to each segmentation image point from the predicted class data; Determining the edge mapping matrix based on each predicted segmentation coordinate and the standard segmentation image; Determining the class loss matrix based on each predicted object class and the standard class data; Determining the distance correlation matrix based on a preset distance threshold and each predicted segmentation coordinate; The determining the segmentation loss function based on the edge mapping matrix, the class loss matrix, and the distance correlation matrix includes: For each segmentation image point pair in the predicted segmentation image, obtaining the edge matrix parameter value and the distance matrix parameter value corresponding to the segmentation image point pair in the edge mapping matrix and the distance correlation matrix respectively; Setting the fusion matrix parameter value corresponding to the segmentation image point pair in the edge distance matrix to the product result of the edge matrix parameter value and the distance matrix parameter value; Determining the segmentation loss function based on the edge distance matrix and the class loss matrix.
2. The method according to claim 1, wherein The determining the edge mapping matrix based on each predicted segmentation coordinate and the standard segmentation image includes: For each segmentation image point in the predicted segmentation image, determining whether the predicted segmentation coordinate corresponding to the segmentation image point exists in the set of standard image points corresponding to the standard segmentation image; If so, setting the predicted accuracy corresponding to the segmentation image point to a first value; If not, setting the predicted accuracy corresponding to the segmentation image point to 0; For each segmentation image point pair in the predicted segmentation image, determining an accuracy probability based on the two predicted accuracies corresponding to the segmentation image point pair, and setting the edge matrix parameter value corresponding to the segmentation image point pair in the edge mapping matrix to the accuracy probability.
3. The method according to claim 1, wherein Determining a class loss matrix based on each of the predicted object classes and the standard class data includes: For each pair of segmented image points in the predicted segmented image, determining a predicted class mapping based on the two predicted object classes corresponding to the pair of segmented image points; Obtaining the two standard object classes corresponding to the pair of segmented image points from the standard class data, and determining a standard class mapping based on the two standard object classes; When the predicted class mapping is the same as the standard class mapping, setting the class matrix parameter value corresponding to the pair of segmented image points in the class loss matrix to a second value; When the predicted class mapping is different from the standard class mapping, setting the class matrix parameter value corresponding to the pair of segmented image points in the class loss matrix to 0.
4. The method according to claim 1, wherein Determining a distance correlation matrix based on a preset distance threshold and each of the predicted segmentation coordinates includes: For each pair of segmented image points in the predicted segmented image, determining an image point distance based on the two predicted segmentation coordinates corresponding to the pair of segmented image points, and determining whether the image point distance is less than the preset distance threshold and not 0; If so, determining a correlation probability based on the image point distance, and setting the distance matrix parameter value corresponding to the pair of segmented image points in the distance correlation matrix to the correlation probability; If not, setting the distance matrix parameter value corresponding to the pair of segmented image points in the distance correlation matrix to 0.
5. The method according to claim 1, wherein Determining a segmentation loss function based on the edge distance matrix and the class loss matrix includes: For each pair of segmented image points in the predicted segmented image, obtaining the fusion matrix parameter value and the class matrix parameter value corresponding to the pair of segmented image points in the edge distance matrix and the class loss matrix respectively; Determining a geometric matrix parameter value corresponding to the pair of segmented image points based on the fusion matrix parameter value and the class matrix parameter value; Determining a geometric loss function based on the geometric matrix parameter values respectively corresponding to each of the pairs of segmented image points, and determining a segmentation loss function based on the geometric loss function.
6. A training device for an image segmentation model, characterized in that, Including: A predicted segmented image output module, configured to input a training image into an initial image segmentation model that has not been trained yet, and obtain an output predicted segmented image and predicted class data; An edge mapping matrix determination module, configured to determine an edge mapping matrix, a class loss matrix, and a distance correlation matrix based on the predicted segmented image, the predicted class data, the standard segmented image, and the standard class data; A segmentation loss function determination module, configured to determine a segmentation loss function based on the edge mapping matrix, the class loss matrix, and the distance correlation matrix; A target image segmentation model determination module, configured to adjust the model parameters of the initial image segmentation model based on the segmentation loss function until the segmentation loss function converges, and obtain a trained target image segmentation model; Among them, the edge mapping matrix characterizes the accuracy probability of each segmented image point pair in the predicted segmentation image relative to the standard segmentation image, the category loss matrix characterizes whether the predicted category mapping of each segmented image point pair in the predicted segmentation image is the same as the standard category mapping, and the distance correlation matrix characterizes the correlation probability of each segmented image point pair in the predicted segmentation image; The edge mapping matrix determination module includes: A predicted segmentation coordinate acquisition unit, configured to acquire the predicted segmentation coordinates corresponding to each segmented image point in the predicted segmentation image, and acquire the predicted object category corresponding to each segmented image point from the predicted category data; An edge mapping matrix determination unit, configured to determine an edge mapping matrix based on each of the predicted segmentation coordinates and the standard segmentation image; A category loss matrix determination unit, configured to determine a category loss matrix based on each of the predicted object categories and the standard category data; A distance correlation matrix determination unit, configured to determine a distance correlation matrix based on a preset distance threshold and each of the predicted segmentation coordinates; The segmentation loss function determination module includes: An edge matrix parameter value acquisition unit, configured to, for each segmented image point pair in the predicted segmentation image, acquire the edge matrix parameter value and the distance matrix parameter value corresponding to the segmented image point pair in the edge mapping matrix and the distance correlation matrix respectively; An edge distance matrix determination unit, configured to set the fusion matrix parameter value corresponding to the segmented image point pair in the edge distance matrix to the product result corresponding to the edge matrix parameter value and the distance matrix parameter value; A segmentation loss function determination unit, configured to determine a segmentation loss function based on the edge distance matrix and the category loss matrix.
7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the training method of the image segmentation model according to any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the training method of the image segmentation model according to any one of claims 1-5 when executed by a processor.
Citation Information
Patent Citations
Photonic processing systems and methods
CN112384748A
Weak supervision semantic segmentation method and device, electronic equipment and storage medium
CN114463335A