Image segmentation model processing method, device, equipment and storage medium
By calculating the distance and area between the detection target and the prediction area and adjusting the parameters of the image segmentation model, the problems of slow training speed and low performance in deep learning image segmentation are solved, and faster convergence and higher segmentation accuracy are achieved.
Patent Information
- Application Number
- CN202210134701.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-02-14
AI Technical Summary
When using deep learning technology for image segmentation, the design of the loss function affects the image segmentation performance. Existing technologies are difficult to effectively improve the training convergence speed and segmentation performance of image segmentation models.
By calculating the distance between the center point and the pixel point of the detection target in the sample image, as well as the distance between the center point and the pixel point of the prediction area, the first loss function value is determined, and based on this, the parameters of the image segmentation model are adjusted. Combined with the area and intersection area of the prediction area, the third loss function value is determined to guide the optimization direction of the image segmentation model.
The convergence speed and segmentation performance of the image segmentation model during training are improved, and the data processing efficiency and accuracy of the prediction results of the image segmentation model are improved.
Smart Images

Figure CN114463354B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer vision technology, and in particular to the field of deep learning technology. Background Art
[0002] Image segmentation is the foundation of computer vision and a crucial component of image understanding. Image segmentation involves dividing an image into several non-overlapping regions based on features such as grayscale, color, spatial texture, and geometric shape, ensuring that these features appear consistent or similar within the same region while distinctly different across different regions. When using deep learning techniques for image segmentation, the design of the loss function is a key factor influencing image segmentation performance. Summary of the Invention
[0003] The present disclosure provides a method, apparatus, device, and storage medium for processing an image segmentation model.
[0004] According to one aspect of the present disclosure, a method for processing an image segmentation model is provided, comprising:
[0005] Using the image segmentation model to determine the predicted area corresponding to the detection target in the sample image;
[0006] Determine a first loss function value corresponding to the sample image based on the distance between the center point of the detection target and each pixel point of the detection target in the sample image, and the distance between the center point and each pixel point of the prediction area;
[0007] Adjust the parameters of the image segmentation model according to the first loss function value.
[0008] According to another aspect of the present disclosure, there is provided an image processing method, comprising:
[0009] The image to be processed is segmented using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to the processing method of any image segmentation model in the embodiments of the present disclosure.
[0010] According to another aspect of the present disclosure, a processing device for an image segmentation model is provided, comprising:
[0011] A determination module, configured to determine a prediction region corresponding to a detection target in a sample image using an image segmentation model;
[0012] A first processing module is configured to determine a first loss function value corresponding to the sample image based on a distance between a center point of a detection target and each pixel of the detection target in the sample image, and a distance between the center point and each pixel of a prediction area;
[0013] The second processing module is used to adjust the parameters of the image segmentation model according to the first loss function value.
[0014] According to another aspect of the present disclosure, there is provided an image processing apparatus comprising:
[0015] An image processing module is used to perform image segmentation on the image to be processed using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to the processing method of any image segmentation model in the embodiments of the present disclosure.
[0016] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0017] at least one processor; and
[0018] a memory communicatively connected to at least one processor; wherein,
[0019] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute any one of the image segmentation model processing methods in the embodiments of the present disclosure.
[0020] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute any one of the task processing methods in the embodiments of the present disclosure.
[0021] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any one of the image segmentation model processing methods in the embodiments of the present disclosure when executed by a processor.
[0022] One embodiment of the above application has the following advantages or beneficial effects: based on the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area, the first loss function value corresponding to the sample image is determined, taking into account the influence of distance on the segmentation performance of the image segmentation model, so adjusting the parameters of the image segmentation model through the first loss function value can accurately guide the optimization direction of the image segmentation model and improve the convergence speed of the image segmentation model during training. In addition, since the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area can represent the shape of the detection target and the prediction area, taking into account the influence of shape on the segmentation performance of the image segmentation model, the parameters of the image segmentation model are adjusted through the first loss function value, effectively improving the segmentation performance of the trained image segmentation model.
[0023] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings are used to better understand the present invention and do not constitute a limitation of the present invention.
[0025] Figure 1 is a flowchart of a method for processing an image segmentation model according to an embodiment of the present disclosure;
[0026] Figure 2 is a flowchart of a method for processing an image segmentation model according to another embodiment of the present disclosure;
[0027] Figure 3A is a schematic diagram of the intersection area of the detection target and the prediction area in the embodiment of the present disclosure Figure 1 ;
[0028] Figure 3B is a schematic diagram of the intersection area of the detection target and the prediction area in the embodiment of the present disclosure Figure 2 ;
[0029] Figure 4 is a schematic diagram of multiple detection targets and multiple target areas in a processing method of an image segmentation model according to another embodiment of the present disclosure;
[0030] Figure 5 is a flowchart of an image processing method according to an embodiment of the present disclosure;
[0031] Figure 6 is a block diagram of a processing device for an image segmentation model according to an embodiment of the present disclosure;
[0032] Figure 7 is a block diagram of a processing device for an image segmentation model according to another embodiment of the present disclosure;
[0033] Figure 8 is a block diagram of an image processing apparatus according to an embodiment of the present disclosure;
[0034] Figure 9 It is a block diagram of an electronic device used to implement the image segmentation model processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The following description of exemplary embodiments of the present disclosure is made in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding. These details should be considered as merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0036] Figure 1 FIG. 1 is a flowchart of a method for processing an image segmentation model according to an embodiment of the present disclosure. Figure 1 As shown, the method may include:
[0037] S101, using an image segmentation model to determine a prediction area corresponding to a detection target in a sample image;
[0038] S102, determining a first loss function value corresponding to the sample image based on the distance between the center point of the detection target and each pixel of the detection target in the sample image, and the distance between the center point and each pixel of the prediction area;
[0039] S103. Adjust parameters of the image segmentation model according to the first loss function value.
[0040] In step S101, the image segmentation model can be, for example, a trained fully convolutional network (FCN), a trained instance segmentation model (Deep Mask), or an image segmentation model based on a genetic algorithm (GA). It should be noted that different image segmentation models require different parameters to be adjusted during training, which can be adjusted according to actual conditions and are not limited here.
[0041] For example, the sample image can be a traffic image, a satellite image, a facial image, or a medical image, such as a lung image. When the sample image is a traffic image, the detection target can be a target vehicle, a target lane line, etc.; when the sample image is a satellite image, the detection target can be a target building, etc.; when the sample image is a facial image, the detection target can be a target face; and when the sample image is a lung image, the detection target can be a lung nodule.
[0042] In this embodiment, a lung image is used as an example. Pulmonary nodules in the lung image are marked, and then the lung image is segmented according to the image segmentation model to obtain predicted regions corresponding to the pulmonary nodules in the lung image. The predicted regions are then marked on the sample image.
[0043] In step S102, for example, the coordinates of the center point of the detection target in the sample image can be calculated using OpenCV, and then the coordinates of each pixel in the detection target and the coordinates of each pixel in the prediction area can be determined. Based on the coordinates of the center point of the detection target and the coordinates of each pixel in the detection target, the distance between the center point of the detection target and each pixel in the detection target is obtained. Based on the coordinates of the center point of the detection target and the coordinates of each pixel in the prediction area, the distance between the center point of the detection target and each pixel in the prediction area is determined. A first loss function is obtained by comparing the above two distances.
[0044] In the technical solution disclosed herein, the first loss function value corresponding to the sample image is determined based on the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area. This takes into account the effect of distance on the segmentation performance of the image segmentation model. Therefore, by adjusting the parameters of the image segmentation model through the first loss function value, the optimization direction of the image segmentation model can be accurately guided, thereby improving the convergence speed of the image segmentation model during training. Furthermore, since the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area can characterize the shape of the detection target and the prediction area, and taking into account the effect of shape on the segmentation performance of the image segmentation model, the parameters of the image segmentation model are adjusted through the first loss function value, thereby effectively improving the segmentation performance of the trained image segmentation model. This can also improve data processing efficiency.
[0045] In one embodiment, Figure 2 As shown, adjusting the parameters of the image segmentation model according to the first loss function value includes:
[0046] S201, determining a third loss function value of the sample image according to the first loss function value and a second loss function value determined based on the area of the prediction region;
[0047] S202. Adjust parameters of the image segmentation model based on the third loss function value.
[0048] For example, the second loss function value, determined based on the area of the predicted region, takes into account the impact of the area on the segmentation performance of the image segmentation model. Therefore, adjusting the parameters of the image segmentation model using the third loss function value determined by the first and second loss function values can address the problem of unbalanced training samples during image segmentation model training, further improving the convergence speed of the image segmentation model during training. At the same time, this effectively improves the segmentation performance of the trained image segmentation model.
[0049] Exemplarily, the first loss function value and the second loss function value may be added to obtain a third loss function value.
[0050] For example, in this embodiment, Loss=ω dice L dice +ω barycenter L barycenter (1)
[0051] Among them, L barycenter is the first loss function value, L Dice is the second loss function value, Loss is the third loss function value, ω dice ,ω barycenter is the weight coefficient, which takes a value of [0,1] and can be set according to actual needs.
[0052] In one embodiment, the above method further includes:
[0053] Determine the intersection area between the detection target and the prediction area in the sample image;
[0054] Based on the intersection area and the area of the prediction region, a second loss function value corresponding to the sample image is determined.
[0055] Exemplarily, the second loss function value is determined by comparing the intersection area and the area of the predicted area. The intersection area and the area of the predicted area are used to characterize the similarity between the detection target and the predicted area. Taking into account the influence of the area on the segmentation performance of the image segmentation model, the parameters of the image segmentation model are adjusted by the second loss function value, so that the prediction results of the trained image segmentation model are more similar, thereby effectively improving the segmentation performance of the trained image segmentation model.
[0056] In one embodiment, determining the second loss function value corresponding to the sample image based on the intersection area and the area of the prediction region includes:
[0057] Determine the sum of the areas of the detection target and the prediction area;
[0058] Based on the intersection area and the total area, a second loss function value corresponding to the sample image is determined.
[0059] In this embodiment, the second loss function value formed based on the ratio of the intersection area and the sum of the areas of the detection target and the prediction area can measure the similarity between the detection target and the prediction area from a global perspective of the sample image. At the same time, it is not affected by the size of the foreground image and the background image during image segmentation.
[0060] In one example, refer to Figure 3A ,
[0061]
[0062] Among them, T pis the intersection area between the detection target and the prediction area, F N F is the remaining area after removing the intersection area in the detection target. P is the intersection area between the sample image without the detection target and the prediction area A'.
[0063] In another example, refer to Figure 3B ,
[0064]
[0065] Among them, L Dice is the second loss function value, intersectin is the intersection area between the detection target A and the prediction area A', and union is the sum of the areas of the detection target A and the prediction area A'.
[0066] In one embodiment, determining a first loss function value corresponding to the sample image based on the distance between the center point of the detection target and each pixel of the detection target in the sample image, and the distance between the center point and each pixel of the prediction area, includes:
[0067] The target distance is calculated based on the distance between the center point of the detection target in the sample image and each pixel point in the prediction area;
[0068] The predicted distance is calculated based on the distance from the center point of the detected target in the sample image to each pixel in the prediction area;
[0069] The first loss function value corresponding to the sample image is calculated based on the difference between the target distance and the predicted distance, and the sum of the target distance and the predicted distance.
[0070] For example, the distance between the center point of the detected target in the sample image and each pixel in the prediction area is determined, and the average of the distances between the center point of the detected target in the sample image and each pixel in the prediction area is calculated as the target distance. It should be noted that the average value can better reflect the distance between the detected target and the prediction area.
[0071] Determine the distance from the center point of the detected object in the sample image to each pixel in the prediction area, and calculate the average of the distances from the center point of the detected object in the sample image to each pixel in the prediction area as the predicted distance. It should be noted that the average value can better reflect the distance between the detected object and the prediction area.
[0072] The ratio of the absolute value of the difference between the target distance and the predicted distance to the sum of the target distance and the predicted distance is used as the first loss function value corresponding to the sample image. The parameters of the image segmentation model can be adjusted based on the first loss function value, so that the image segmentation model converges quickly during training.
[0073] In this embodiment,
[0074] Among them, L barycenter is the first loss function value, DIS gt_self is the target distance, DIS gt_pred is the predicted distance.
[0075] In one embodiment, determining a predicted region corresponding to a detection target in a sample image using an image segmentation model includes:
[0076] Determining at least one target region in the sample image using an image segmentation model;
[0077] determining, based on the distance between the center point of the detection target and the center point of each target area in the at least one target area in the sample image, the target area with the shortest distance to the center point of the detection target;
[0078] The target area with the shortest distance to the center point of the detected target is used as the predicted area corresponding to the detected target.
[0079] For example, Figure 4 As shown, the lung image (sample image) may include at least one lung nodule (detection target), and the connected domain of each lung nodule on the sample image is marked as A. The lung image is segmented according to the image segmentation model, and at least one target area is obtained in the sample image. The connected domain of the target area on the sample image is marked as A'.
[0080] Determine the coordinates of the center point of each lung nodule, denoted as (x mask ,y mask ), and the center coordinates of each target area (x pred ,y pred Calculate the distance between the center coordinates of each lung nodule and the center coordinates of each target region. The target region with the shortest distance to the center coordinates of the lung nodule is used as the predicted region corresponding to the lung nodule.
[0081] Determine the distance between the center point of each lung nodule and each pixel point of its corresponding prediction area, and calculate the average value of the above distances as the target distance; determine the distance from the center point of each lung nodule to each pixel point of the prediction area, and calculate the average value of the above distances as the prediction distance; obtain the first loss function value based on the ratio of the absolute value of the difference between the target distance and the prediction distance to the sum of the target distance and the prediction distance.
[0082] Determine the intersection area of each pulmonary nodule and its corresponding predicted area, and determine the total area of each pulmonary nodule and its corresponding predicted area; determine the second loss function value based on the ratio of the intersection area and the total area.
[0083] The first and second loss function values are added according to a preset ratio to obtain a third loss function value. Based on the third loss function value for each of the multiple lung nodules, an average loss value for the multiple lung nodules is calculated, and the average loss value is used as the loss value for the sample image. As can be seen, since the loss is calculated for each lung nodule in the sample image, significant differences in segmentation performance between different objects in the same sample are avoided, further improving the segmentation performance of the trained image segmentation model.
[0084] In order to more fully understand the features and technical content of the embodiments of the present disclosure, a specific application example is provided below for illustration. It should be understood that the following application example is only for reference and does not limit the specific implementation process.
[0085] In this application example, the image processing method includes:
[0086] 1. Mark the connected domain of the given segmentation label image (i.e., the detection target), recorded as mask_connected_list;
[0087] 2. Mark the connected domain of the prediction result image, recorded as pred_connected_list;
[0088] 3. Calculate the center coordinates (x pred ,y pred ), get coordinate_list;
[0089] 4. Calculate the center coordinates of the connected domain (mask_conn) of any given segmentation label image, denoted as (x mask ,y mask );
[0090] 5. Calculate the distance from the center of the connected domain mask_conn to the center coordinates of the connected domain of each predicted result image;
[0091] 6. Find the connected domain pred_conn of the predicted result image closest to mask_conn among the distances obtained in step 5;
[0092] 7. Calculate the third loss function value (Loss):
[0093] Loss=ω dice L dice +ω barycenter L barycenter
[0094] Among them, L barycenter is the first loss function value, L Dice is the second loss function value, Loss is the third loss function value, ω dice ,ω barycenter is the weight coefficient, which takes a value of [0,1] and can be set according to actual needs.
[0095] in, Among them, union is the sum of the areas of the connected domain pred_conn and the connected domain mask_conn determined in step 6, and intersection is the intersection of the connected domain pred_conn and the connected domain mask_conn determined in step 6.
[0096]
[0097] Among them, calculate (x mask ,y mask ) to the distance of each pixel in the connected domain mask_conn, and calculate the mean, which is recorded as DIS gt_self ; Calculate (x mask ,y mask ) to the distance of each pixel in the connected domain pred_conn, and calculate the mean, which is recorded as DIS gt_pred .
[0098] 8. Store the third loss function value (Loss) in the sequence;
[0099] 9. Calculate the average of the loss function values in the sequence as the loss value of the current image.
[0100] Figure 5 FIG. 1 is a flow chart of an image processing method according to an embodiment of the present disclosure. Figure 5 As shown, the method may include:
[0101] S501. Perform image segmentation on the image to be processed using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to a processing method of the image segmentation model.
[0102] In the technical solution disclosed herein, since the image segmentation model is obtained by adjusting the processing method of the image segmentation model, the optimization direction of the image segmentation model can be guided by the first loss function value when training the image segmentation model, thereby improving the convergence speed of the image segmentation model during training. At the same time, since the distance between the center point of the detection target in the sample image and each pixel point of the detection target, as well as the distance between the center point and each pixel point of the prediction area, can represent the shape of the detection target and the prediction area, taking into account the influence of the shape on the segmentation performance of the image segmentation model, the image segmentation model adjusted by the first loss function value can accurately segment the boundary of the image to be processed when performing image segmentation, thereby obtaining an accurate target area.
[0103] Figure 6 FIG. 1 is a block diagram of a processing device for an image segmentation model according to an embodiment of the present disclosure. Figure 6 As shown, the device may include:
[0104] A determination module 601 is configured to determine a prediction region corresponding to a detection target in a sample image using an image segmentation model;
[0105] A first processing module 602 is configured to determine a first loss function value corresponding to the sample image based on a distance between a center point of the detection target and each pixel of the detection target in the sample image, and a distance between the center point and each pixel of the prediction area;
[0106] The second processing module 603 is used to adjust the parameters of the image segmentation model according to the first loss function value.
[0107] Figure 7 FIG. 1 is a block diagram of a processing device for an image segmentation model according to an embodiment of the present disclosure. Figure 7 As shown, the device may include:
[0108] A determination module 701 is configured to determine a prediction region corresponding to a detection target in a sample image using an image segmentation model;
[0109] A first processing module 702 is configured to determine a first loss function value corresponding to the sample image based on a distance between a center point of the detection target and each pixel of the detection target in the sample image, and a distance between the center point and each pixel of the prediction area;
[0110] The second processing module 703 includes:
[0111] a calculating unit 704 configured to determine a third loss function value of the sample image according to the first loss function value and a second loss function value determined based on the area of the prediction region;
[0112] The adjusting unit 705 is configured to adjust parameters of the image segmentation model based on the third loss function value.
[0113] In one embodiment, Figure 7 As shown, the computing unit 704 is further configured to:
[0114] Determine the intersection area between the detection target and the prediction area in the sample image;
[0115] Based on the intersection area and the area of the prediction region, a second loss function value corresponding to the sample image is determined.
[0116] In one embodiment, Figure 7 As shown, the computing unit 704 is further configured to:
[0117] Determine the sum of the areas of the detection target and the prediction area;
[0118] Based on the intersection area and the total area, a second loss function value corresponding to the sample image is determined.
[0119] In one embodiment, Figure 7 As shown, the first processing module 702 is further configured to:
[0120] The target distance is calculated based on the distance between the center point of the detection target in the sample image and each pixel point in the prediction area;
[0121] The predicted distance is calculated based on the distance from the center point of the detected target in the sample image to each pixel in the prediction area;
[0122] The first loss function value corresponding to the sample image is calculated based on the difference between the target distance and the predicted distance, and the sum of the target distance and the predicted distance.
[0123] In one embodiment, Figure 7 As shown, the determination module 701 is further configured to:
[0124] Determining at least one target region in the sample image using an image segmentation model;
[0125] determining, based on the distance between the center point of the detection target and the center point of each target area in the at least one target area in the sample image, the target area with the shortest distance to the center point of the detection target;
[0126] The target area with the shortest distance to the center point of the detected target is used as the predicted area corresponding to the detected target.
[0127] In this way, the device of the embodiment of the present disclosure determines the first loss function value corresponding to the sample image based on the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area, taking into account the influence of distance on the segmentation performance of the image segmentation model. Therefore, by adjusting the parameters of the image segmentation model through the first loss function value, it is possible to accurately guide the optimization direction of the image segmentation model and improve the convergence speed of the image segmentation model during training. In addition, since the distance between the center point of the detection target in the sample image and each pixel of the detection target, as well as the distance between the center point and each pixel of the prediction area, can characterize the shape of the detection target and the prediction area, taking into account the influence of shape on the segmentation performance of the image segmentation model, the parameters of the image segmentation model are adjusted through the first loss function value to effectively improve the segmentation performance of the trained image segmentation model.
[0128] Figure 8 FIG is a block diagram of an image processing apparatus according to an embodiment of the present disclosure. Figure 9 As shown, the device may include:
[0129] The image processing module 801 is used to perform image segmentation on the image to be processed using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to a processing method of the image segmentation model.
[0130] In this way, the device of the embodiment of the present disclosure, since the image segmentation model is obtained by adjusting the processing method of the image segmentation model, can guide the optimization direction of the image segmentation model by the first loss function value when training the image segmentation model, thereby improving the convergence speed of the image segmentation model during training. At the same time, since the distance between the center point of the detection target in the sample image and each pixel point of the detection target, as well as the distance between the center point and each pixel point of the prediction area can characterize the shape of the detection target and the prediction area, taking into account the influence of the shape on the segmentation performance of the image segmentation model, the image segmentation model adjusted by the first loss function value can accurately segment the boundary of the image to be processed when performing image segmentation, thereby obtaining an accurate target area.
[0131] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0132] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0133] Figure 9A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device 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 assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are provided as examples only and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0134] like Figure 9 As shown, the device 900 includes a computing unit 901, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 902 or a computer program loaded from a storage unit 908 into a random access memory (RAM) 903. Various programs and data required for the operation of the device 900 can also be stored in the RAM 903. The computing unit 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.
[0135] Various components in the device 900 are connected to the I / O interface 905, including an input unit 906, such as a keyboard, a mouse, etc.; an output unit 907, such as various types of displays, speakers, etc.; a storage unit 908, such as a magnetic disk, an optical disk, etc.; and a communication unit 909, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 909 allows the device 900 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0136] The computing unit 901 can be various general-purpose and / or specialized processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as the image segmentation model processing method. For example, in some embodiments, the image segmentation model processing method can be implemented as a computer software program that is tangibly contained in a machine-readable medium, such as the storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on the device 900 via the ROM 902 and / or the communication unit 909. When the computer program is loaded into the RAM 903 and executed by the computing unit 901, one or more steps of the image segmentation model processing method described above can be performed. Alternatively, in other embodiments, the computing unit 901 can be configured to perform the image segmentation model processing method by any other appropriate means (e.g., via firmware).
[0137] Various embodiments of the systems and techniques described above 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), system-on-chip systems (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 are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose 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 data and instructions to the storage system, the at least one input device, and the at least one output device.
[0138] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code 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.
[0139] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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.
[0140] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer 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 pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types 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).
[0141] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.
[0142] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.
[0143] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not a limitation herein.
[0144] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.
Claims
1. A method for processing an image segmentation model, comprising: Using the image segmentation model to determine the predicted area corresponding to the detection target in the sample image; Determine a first loss function value corresponding to the sample image based on a distance between a center point of the detection target and each pixel of the detection target in the sample image, and a distance between the center point and each pixel of the prediction area; Adjusting parameters of the image segmentation model according to the first loss function value; The determining of the first loss function value corresponding to the sample image based on the distance between the center point of the detection target and each pixel of the detection target in the sample image, and the distance between the center point and each pixel of the prediction area, includes: Calculating a target distance based on a distance between a center point of the detection target and each pixel point of the detection target in the sample image; Calculating a predicted distance based on the distance from the center point of the detection target in the sample image to each pixel point of the prediction area; A first loss function value corresponding to the sample image is calculated based on a difference between the target distance and the predicted distance, and a sum of the target distance and the predicted distance.
2. The method according to claim 1, wherein The adjusting the parameters of the image segmentation model according to the first loss function value includes: determining a third loss function value of the sample image according to the first loss function value and a second loss function value determined based on the area of the prediction region; Parameters of the image segmentation model are adjusted based on the third loss function value.
3. The method according to claim 2, further comprising: determining an intersection area between the detection target and the prediction area in the sample image; Based on the intersection area and the area of the prediction region, a second loss function value corresponding to the sample image is determined.
4. The method according to claim 3, wherein: The determining, based on the intersection area and the area of the prediction region, a second loss function value corresponding to the sample image includes: Determining the sum of the areas of the detection target and the prediction area; Based on the intersection area and the area sum, a second loss function value corresponding to the sample image is determined.
5. The method according to any one of claims 1 to 4, wherein Determining the predicted area corresponding to the detection target in the sample image by using the image segmentation model includes: Determining at least one target region in the sample image using an image segmentation model; determining, based on the distance between the center point of the detection target and the center point of each target area in the at least one target area in the sample image, the target area with the shortest distance to the center point of the detection target; The target area with the shortest distance from the center point of the detection target is used as the predicted area corresponding to the detection target.
6. An image processing method, comprising: Perform image segmentation on the image to be processed using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to the method according to any one of claims 1 to 5.
7. A processing device for an image segmentation model, comprising: A determination module, configured to determine a prediction region corresponding to a detection target in a sample image using an image segmentation model; a first processing module, configured to determine a first loss function value corresponding to the sample image based on a distance between a center point of the detection target and each pixel of the detection target in the sample image, and a distance between the center point and each pixel of the prediction area; a second processing module, configured to adjust parameters of an image segmentation model according to the first loss function value; Wherein, the first processing module is further used for: Calculating a target distance based on a distance between a center point of the detection target and each pixel point of the detection target in the sample image; Calculating a predicted distance based on a distance from a center point of the detection target in the sample image to each pixel point of the prediction area; A first loss function value corresponding to the sample image is calculated based on a difference between the target distance and the predicted distance, and a sum of the target distance and the predicted distance.
8. The device according to claim 7, wherein The second processing module includes: a calculation unit, configured to determine a third loss function value of the sample image according to the first loss function value and a second loss function value determined based on the area of the prediction region; An adjustment unit is used to adjust parameters of the image segmentation model based on the third loss function value.
9. The apparatus according to claim 8, wherein the computing unit is further configured to: determining an intersection area between the detection target and the prediction area in the sample image; Based on the intersection area and the area of the prediction region, a second loss function value corresponding to the sample image is determined.
10. The device according to claim 9, wherein The computing unit is further configured to: Determining the sum of the areas of the detection target and the prediction area; Based on the intersection area and the area sum, a second loss function value corresponding to the sample image is determined.
11. The device according to any one of claims 7 to 10, wherein: The determining module is further configured to: Determining at least one target region in the sample image using an image segmentation model; determining, based on the distance between the center point of the detection target and the center point of each target area in the at least one target area in the sample image, the target area with the shortest distance to the center point of the detection target; The target area with the shortest distance from the center point of the detection target is used as the prediction area corresponding to the detection target.
12. An image processing apparatus, comprising: An image processing module is used to perform image segmentation on an image to be processed using an image segmentation model to determine at least one target area in the image to be processed; wherein the image segmentation model is adjusted according to the method according to any one of claims 1 to 5.
13. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 6.
15. A computer program product comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
End-to-end mammary gland ultrasound image segmentation method based on Distance-AttU-Net (Distance-AttU-Net)
CN111047608A
Target object positioning method and device, image processing method and device and computer equipment
CN111914809A