Model training method, image segmentation method, device, medium and program product

Through a new model training method, the model parameters are adjusted using the training image and its segmentation results, and the problem of monitoring security image segmentation in the existing technology requires multiple model training, which improves training efficiency and segmentation ability.

CN119741498APending Publication Date: 2025-04-01INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411954701.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

In the prior art, due to the high resolution of the monitoring security image and the complex and diverse scenes, multiple trainings of the model are required to complete the segmentation of the monitoring security image, resulting in high process complexity and low efficiency.

Method used

A model training method is provided, by obtaining the training image and its segmentation results, inputting the image and category labels into the model, adjusting the model parameters until the iteration end condition is reached, and a model is generated for image segmentation.

Benefits of technology

This reduces the complexity and time of model training, improves the efficiency of model training, and enables the model to segment multiple targets in the image at one time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119741498A_ABST
    Figure CN119741498A_ABST
Patent Text Reader

Abstract

The invention discloses a model training method, an image segmentation method, equipment, a medium and a program product, and relates to the field of artificial intelligence, and the model training method comprises the steps: obtaining a first training image, a to-be-segmented training category, a to-be-segmented training task, and a training segmentation result of the first training image; inputting the training information into a to-be-trained model to obtain a plurality of mask candidate areas output by the to-be-trained model and a training category text corresponding to each mask candidate area; adjusting model parameters of the to-be-trained model according to the output result and the training segmentation result to obtain a new to-be-trained model; and taking the second training image as a new first training image, returning to the step of inputting the information into the new to-be-trained model until a preset iteration ending condition is met, and taking the new to-be-trained model as an image segmentation model. The complexity of model training is reduced, the efficiency of model training is improved, and the efficiency and accuracy of image segmentation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of artificial intelligence technology, and in particular to a model training method, image segmentation method, device, medium and program product. Background Art

[0002] The surveillance security in bank scenarios often faces a more complex environment due to the large flow of people. With the iteration of camera hardware, current surveillance scenes often include larger images and higher resolutions, so more targets appear in the picture. Image segmentation can separate, identify and classify targets, and has become a more important part of the research on monitoring image analysis.

[0003] At present, since surveillance images contain many types of targets such as vehicles, vehicles, buildings, and people, in the current image segmentation model, multiple images need to be processed multiple times to complete the labeling of multiple targets in the surveillance images.

[0004] However, due to the high resolution and complex and diverse scenes of surveillance and security images, the model needs to be trained multiple times before multiple images are processed multiple times to complete the segmentation of surveillance and security images. This process is highly complex and inefficient. Summary of the invention

[0005] The present application provides a model training method, an image segmentation method, a device, a medium and a program product to solve the problem in the prior art that due to the high resolution and complex and diverse scenes of surveillance security images, the model needs to be trained multiple times before multiple images are processed multiple times to complete the segmentation of the surveillance security images, and the process is highly complex and inefficient.

[0006] In a first aspect, the present application provides a model training method, the method comprising:

[0007] Obtain a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes a plurality of image training regions and a category label corresponding to each of the image training regions, the first training image is an image to be trained in a training image library, and the training image library includes a plurality of images to be trained and a training segmentation result of each of the images to be trained;

[0008] Inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained, and obtaining a plurality of mask candidate regions output by the model to be trained and a training category text corresponding to each mask candidate region;

[0009] Adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region, and the training segmentation result to obtain a new model to be trained;

[0010] The second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image. Return to execute the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmented areas, and each of the segmented areas corresponds to an image category.

[0011] In a second aspect, the present application also provides an image segmentation method, the method comprising:

[0012] Acquire an image to be segmented, a first target segmentation category, and a first target segmentation task;

[0013] The image to be segmented, the first target segmentation category and the first target segmentation task are input into an image segmentation model to obtain multiple first target mask candidate areas output by the image segmentation model and the first target category text corresponding to each first target mask candidate area; wherein the image segmentation model is a model trained according to the model training method described in the first aspect of the present application, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task.

[0014] In a third aspect, the present application provides a model training device, comprising:

[0015] A training acquisition module, used to acquire a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes a plurality of image training regions and a category label corresponding to each of the image training regions, the first training image is an image to be trained in a training image library, and the training image library includes a plurality of images to be trained and a training segmentation result of each of the images to be trained;

[0016] A first input module, used for inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained, to obtain a plurality of mask candidate regions output by the model to be trained and a training category text corresponding to each mask candidate region;

[0017] An adjustment module, used for adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region and the training segmentation result to obtain a new model to be trained;

[0018] A model determination module is used to use the second training image as a new first training image, and the training segmentation result of the second training image as the training segmentation result of the new first training image, and return to execute the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" until a preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmented areas, and each of the segmented areas corresponds to an image category.

[0019] In a fourth aspect, the present application provides an image segmentation device, comprising:

[0020] An image acquisition module, used to acquire an image to be segmented, a first target segmentation category, and a first target segmentation task;

[0021] A second input module is used to input the image to be segmented, the first target segmentation category and the first target segmentation task into the image segmentation model to obtain multiple first target mask candidate areas output by the image segmentation model and the first target category text corresponding to each first target mask candidate area; wherein the image segmentation model is a model trained according to the model training method described in the first aspect of the present application, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task.

[0022] In a fifth aspect, the present application provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the model training method as described in the first aspect of the present application, or implements the image segmentation method as described in the second aspect of the present application.

[0023] In a sixth aspect, the present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method as described in the first aspect of the present application, or implements the image segmentation method as described in the second aspect of the present application.

[0024] In a seventh aspect, the present application provides a computer program product, comprising a computer program, which, when executed by a processor, implements the model training method as described in the first aspect of the present application, or implements the image segmentation method as described in the second aspect of the present application.

[0025] The model training method of the present application obtains a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes multiple image training areas and a category label corresponding to each image training area, the first training image is an image to be trained in a training image library, and the training image library includes multiple images to be trained and a training segmentation result of each image to be trained; the first training image, the training category to be segmented, and the training task to be segmented are input into the model to be trained, and multiple mask candidate areas output by the model to be trained and a training category text corresponding to each mask candidate area are obtained; according to the multiple mask candidate areas and the training category text corresponding to each mask candidate area, The training category text and the training segmentation result adjust the model parameters of the model to be trained to obtain a new model to be trained; the second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image, and the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" is returned to execute until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation areas, and each segmentation area corresponds to an image category. That is, the model training method of the present application, on the one hand, trains the ability of the model to be trained to segment the image to obtain multiple mask candidate areas, and to match each mask candidate area with the training category to be segmented according to the training task to be segmented, so that the model does not need to be trained one by one according to the characteristics of the target in the image, so that the model can complete the segmentation of multiple targets in the image at one time, reducing the complexity of model training and improving the efficiency of model training. On the other hand, by performing image segmentation on the image to be segmented through the image segmentation model, the target in the image to be segmented can be quickly identified and determined, thereby improving the efficiency and accuracy of image segmentation. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0027] Figure 1It is a flowchart of the model training method provided in this application;

[0028] Figure 2 is another flow chart of the model training method provided by this application;

[0029] Figure 3 It is a flowchart of the image segmentation method provided by this application;

[0030] Figure 4 It is a structural schematic diagram of the model training device provided by this application;

[0031] Figure 5 It is a structural schematic diagram of the image segmentation device provided by the present application;

[0032] Figure 6 It is a structural schematic diagram of the electronic device provided by this application. DETAILED DESCRIPTION

[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0034] The acquisition, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0035] Figure 1 This is a flow chart of the model training method provided by the present application. The method can be executed by the model training device provided by the present application, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device. For example, the device can be integrated in a computer. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 1 , the method may specifically include the following steps:

[0036] Step 101: Obtain a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image.

[0037] The training segmentation result includes multiple image training areas and a category label corresponding to each image training area. The first training image is an image to be trained in a training image library. The training image library includes multiple images to be trained and a training segmentation result of each image to be trained.

[0038] Specifically, the first training image refers to an image to be segmented during the training process. The training category to be segmented of the first training image refers to the category output in the image segmentation result. For example, the training category to be segmented may be a person, a vehicle, or a tree. The training task to be segmented of the first training image refers to the goal of image segmentation. For example, the training task to be segmented may be segmenting a person and a vehicle. The training segmentation result of the first training image refers to an object of the training category to be segmented obtained in the first training image after the first training image is segmented according to the training task to be segmented.

[0039] The first training image and the training segmentation result of the first training image may be obtained by the electronic device executing this embodiment from a pre-built training image library, wherein the training image library includes a plurality of images to be trained and the training segmentation result of each image to be trained. The training category to be segmented and the training task to be segmented may be obtained by the electronic device executing this embodiment from a target image segmentation task received by the electronic device.

[0040] Step 102: input the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained, and obtain multiple mask candidate regions output by the model to be trained and the training category text corresponding to each mask candidate region.

[0041] Specifically, the mask candidate regions are used to represent regions in the image that may belong to a certain type of target. These regions are unlabeled after segmentation and only express the spatial position and shape information of the region. The first training image, the training category to be segmented, and the training task to be segmented are input into the model to be trained to obtain the object regions determined after multiple image segmentation output by the model to be trained, i.e., multiple mask candidate regions. And after the first training image is segmented according to the training task to be segmented, the objects in the first training image whose category is the training category to be segmented are the training category texts corresponding to each mask candidate region.

[0042] Optionally, the model to be trained includes a mask extractor to be trained, a text encoder to be trained, and a segmentation result output unit to be trained, and step 102 can be implemented through steps 1021 to 1023.

[0043] Step 1021: input the first training image into the mask extractor to be trained to obtain a plurality of mask candidate regions output by the mask extractor to be trained.

[0044] Specifically, the first training image is input into the mask extractor to be trained, the mask extractor to be trained encodes the first training image into visual features and generates a classless mask, and then the mask extractor to be trained outputs a plurality of mask candidate regions.

[0045] Step 1022: input the training category to be segmented and the training task to be segmented into the text encoder to be trained, and obtain the training embedded text output by the text encoder to be trained.

[0046] The training embedded text is used to indicate the training category to be segmented and the training task to be segmented, and the training category to be segmented includes at least one training category text.

[0047] Specifically, the training category to be segmented and the training task to be segmented are input into the training text encoder, and the training text encoder processes the task and category text to generate a joint text embedding to obtain the training embedded text output by the training text encoder. The training embedded text can indicate the training category to be segmented and the training task to be segmented. The training category to be segmented includes at least one training category text. For example, the training embedded text is an image corresponding to the two categories of people and vehicles segmented in the image.

[0048] Step 1023, inputting the plurality of mask candidate regions and the training embedded text into the to-be-trained segmentation result output unit, and obtaining the training category text corresponding to each mask candidate region output by the to-be-trained segmentation result output unit.

[0049] Specifically, multiple mask candidate regions and training embedded texts are input into the trained segmentation result output unit, and the trained segmentation result output unit determines and outputs the training category text corresponding to each mask candidate region according to the similarity between each mask candidate region and each category in the training embedded text. According to the similarity between each mask candidate region and each category in the training embedded text, the training category text corresponding to each mask candidate region is determined and output, and the model does not need to be trained one by one according to the features of the targets in the image, so that the model can complete the segmentation of multiple targets in the image at one time, reducing the complexity of model training and improving the efficiency of model training.

[0050] Optionally, the mask extractor to be trained is used to generate multiple mask candidate regions according to the visual features of multiple objects in the first training image. The text encoder to be trained is used to splice the training categories to be segmented and the training tasks to be segmented to obtain and output the training embedded text. The segmentation result output unit to be trained is used to determine the training category text corresponding to each mask candidate region according to the similarity between the mask candidate region and at least one training category text in the training embedded text.

[0051] Specifically, after the image is input, the mask extractor to be trained encodes it into visual features and generates a classless mask. Using multi-task labels, such as semantic segmentation, instance segmentation or panoptic segmentation, the mask extraction process is supervised, and the output result is optimized by a loss function. Only one task label is randomly selected for training in each iteration to avoid gradient conflicts. After receiving the training category to be segmented and the training task to be segmented, the text encoder to be trained splices the training category to be segmented and the training task to be segmented to obtain the training embedded text and output it. After receiving multiple mask candidate regions and training embedded text, the output unit of the segmentation result to be trained generates a probability distribution of the category to which each mask belongs for each mask candidate region, and calculates the matching degree between the visual feature and the text embedding through cosine similarity. The higher the cosine similarity value, the stronger the correlation between the mask and the category. Finally, the segmentation mask with the highest category probability is output, thereby determining the training category text corresponding to the mask candidate region. By separately processing the model's mask extractor to be trained, the text encoder to be trained, and the segmentation result output unit to be trained, the image segmentation is gradually completed, thereby reducing the complexity of the image segmentation model and improving the segmentation accuracy of the image segmentation model.

[0052] Step 103 , adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region, and the training segmentation result to obtain a new model to be trained.

[0053] Specifically, according to multiple mask candidate regions, the training category text corresponding to each mask candidate region is compared with the labels of the training categories to be segmented in the training segmentation results and the objects corresponding to the training tasks to be segmented, so as to adjust the model parameters of the model to be trained for the purpose of optimizing the loss, thereby obtaining a new model to be trained.

[0054] Optionally, step 103 may be implemented through steps 1031 to 1033 .

[0055] Step 1031 : adjusting the model parameters of the mask extractor to be trained according to the multiple mask candidate regions and the image training region to obtain a new mask extractor to be trained.

[0056] Specifically, multiple mask candidate regions and image training regions are compared, and the model parameters of the mask extractor to be trained are adjusted for the purpose of optimizing the loss, thereby obtaining a new mask extractor to be trained. The shape and position of the mask are adjusted to more accurately match the actual contour of each category.

[0057] Step 1032, according to the training category text corresponding to each mask candidate region and the category label corresponding to each image training region, the model parameters of the segmentation result output unit to be trained are adjusted to obtain a new segmentation result output unit to be trained.

[0058] Specifically, the training category text corresponding to each candidate mask region and the category label corresponding to each image training region are compared, and the model parameters of the output unit of the segmentation result to be trained are adjusted for the purpose of optimizing the loss, thereby obtaining a new output unit of the segmentation result to be trained. In this way, a more accurate output result of the model is obtained, so that the segmentation result and the category can be matched more accurately.

[0059] Step 1033, determining a new model to be trained according to the new mask extractor to be trained, the text encoder to be trained, and the new segmentation result output unit to be trained.

[0060] Specifically, after obtaining a new mask extractor to be trained and a new segmentation result output unit to be trained, a new model to be trained is determined according to the new mask extractor to be trained, the text encoder to be trained and the new segmentation result output unit to be trained.

[0061] Step 104, taking the second training image as the new first training image, and the training segmentation result of the second training image as the new training segmentation result of the first training image, returning to step 102, until the preset iteration end condition is reached, and taking the new model to be trained as the image segmentation model.

[0062] The second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation regions, and each segmentation region corresponds to an image category.

[0063] Specifically, the second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image, and the step of inputting the image into the model is returned to be executed until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model. For example, the preset iteration end condition may be that the number of training rounds reaches a preset number of rounds, or the training loss is lower than a certain value, etc.

[0064] The model training method of the present application obtains a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes multiple image training areas and a category label corresponding to each image training area, the first training image is an image to be trained in a training image library, and the training image library includes multiple images to be trained and a training segmentation result of each image to be trained; the first training image, the training category to be segmented, and the training task to be segmented are input into the model to be trained, and multiple mask candidate areas output by the model to be trained and a training category text corresponding to each mask candidate area are obtained; according to the multiple mask candidate areas and the training category text corresponding to each mask candidate area, The training category text and the training segmentation result adjust the model parameters of the model to be trained to obtain a new model to be trained; the second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image, and the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" is returned to execute until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation areas, and each segmentation area corresponds to an image category. That is, the model training method of the present application, on the one hand, trains the ability of the model to be trained to segment the image to obtain multiple mask candidate areas, and to match each mask candidate area with the training category to be segmented according to the training task to be segmented, so that the model does not need to be trained one by one according to the characteristics of the target in the image, so that the model can complete the segmentation of multiple targets in the image at one time, reducing the complexity of model training and improving the efficiency of model training. On the other hand, by performing image segmentation on the image to be segmented through the image segmentation model, the target in the image to be segmented can be quickly identified and determined, thereby improving the efficiency and accuracy of image segmentation.

[0065] Figure 2 is another flow chart of the model training method provided by the present application. Figure 1 Based on the illustrated embodiment and various optional implementation schemes, the segmentation categories and the vectorization of the segmentation tasks are described in detail. Figure 2 As shown, the method may include the following steps:

[0066] Step 201 , vectorizing the training categories to be segmented and the training tasks to be segmented.

[0067] Specifically, by vectorizing the training categories to be segmented and the training tasks to be segmented, the training categories to be segmented and the training tasks to be segmented converted into vectors can be obtained. Vectorizing the training categories to be segmented and the training tasks to be segmented can convert the training categories to be segmented and the training tasks to be segmented with other vectorized image segmentation categories and image segmentation tasks, so that the image segmentation model can complete the processing of other image segmentation tasks and categories based on the vector relationship between the training categories to be segmented and other training categories, and the vector relationship between the training tasks to be segmented and other training tasks, avoiding the tedious training process of the model needing to continuously learn different categories of segmentation categories and segmentation tasks, and enhancing the flexibility and learning ability of the model.

[0068] Step 202: Obtain a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image.

[0069] Step 203: input the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained, and obtain multiple mask candidate regions output by the model to be trained and the training category text corresponding to each mask candidate region.

[0070] Optionally, in the case of executing optional step 1022 , step 1022 can be implemented through step 2031 .

[0071] Step 2031, input the vector corresponding to the training category to be segmented and the vector corresponding to the training task to be segmented into the encoder of the text to be trained to obtain the training embedded text output by the encoder of the text to be trained.

[0072] Specifically, the vector corresponding to the training category to be segmented and the vector corresponding to the training task to be segmented are input into the text encoder to be trained. The text encoder to be trained can determine the training category to be segmented and the training task to be segmented through the vector corresponding to the training category to be segmented and the vector corresponding to the training task to be segmented. The text encoder to be trained concatenates the two to obtain the training embedded text output by the text encoder to be trained.

[0073] Step 204 , adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region, and the training segmentation result to obtain a new model to be trained.

[0074] Step 205, taking the second training image as the new first training image, and the training segmentation result of the second training image as the new training segmentation result of the first training image, returning to execute step 203, until the preset iteration end condition is reached, and taking the new model to be trained as the image segmentation model.

[0075] The model training method of the present application performs vectorized conversion on the training categories to be segmented and the training tasks to be segmented, which can convert the training categories to be segmented and the training tasks to be segmented with other vectorized image segmentation categories and image segmentation tasks, so as to provide a data basis for the subsequent image segmentation model to complete the processing of other image segmentation tasks and categories based on the vector relationship between the training categories to be segmented and other training categories, and the vector relationship between the training tasks to be segmented and other training tasks. This avoids the tedious training process of the model needing to continuously learn different categories of segmentation categories and segmentation tasks, and enhances the flexibility and learning ability of the model.

[0076] Figure 3 is a flow chart of the image segmentation method provided by the present application. The method can be executed by the image segmentation device provided by the present application, and the device can be implemented in software and / or hardware. In a specific embodiment, the device can be integrated in an electronic device. For example, the device can be integrated in a computer. The following embodiments will be described by taking the device integrated in an electronic device as an example. Figure 3 , the method may specifically include the following steps:

[0077] Step 301, obtaining an image to be segmented, a first target segmentation category, and a first target segmentation task.

[0078] Specifically, a target image that needs to be segmented, a first target segmentation category corresponding to the image, and a first target segmentation task are obtained.

[0079] Step 302: input the image to be segmented, the first target segmentation category and the first target segmentation task into the image segmentation model to obtain a plurality of first target mask candidate regions output by the image segmentation model and the first target category text corresponding to each first target mask candidate region.

[0080] Specifically, by inputting the image to be segmented, the first target segmentation category and the first target segmentation task into the image segmentation model, the image segmentation result output by the image segmentation model can be obtained, that is, multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area.

[0081] Optionally, when executing step 201 and step 2031, steps 21 to 24 may also be executed.

[0082] Step 21, obtaining a second target segmentation category and a second target segmentation task.

[0083] Specifically, after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task, if it is necessary to segment the image to be segmented for the second time, the second target segmentation category and the second target segmentation task are obtained.

[0084] Step 22, performing vectorization conversion on the second target segmentation category and the second target segmentation task.

[0085] Specifically, the second target segmentation category and the second target segmentation task are described in a vectorized manner, so as to obtain the second target segmentation category and the second target segmentation task converted into vectors.

[0086] Step 23, based on the vector corresponding to the second target segmentation category, the vector corresponding to the training category to be segmented, the vector corresponding to the second target segmentation task, and the vector corresponding to the training task to be segmented, determine the category conversion relationship between the second target segmentation category and the training category to be segmented, as well as the task conversion relationship between the second target segmentation task and the training task to be segmented.

[0087] Specifically, according to the vector corresponding to the second target segmentation category and the vector corresponding to the training category to be segmented, a conversion relationship from the vector corresponding to the second target segmentation category to the vector corresponding to the training category to be segmented is determined as a category conversion relationship, and the conversion relationship can be realized by a conversion relationship between vectors. According to the vector corresponding to the second target segmentation task and the vector corresponding to the training task to be segmented, a conversion relationship from the vector corresponding to the second target segmentation task to the vector corresponding to the training task to be segmented is determined as a task conversion relationship.

[0088] Step 24, input the image to be segmented, the second target segmentation category, the category conversion relationship, the second target segmentation task, and the task conversion relationship into the image segmentation model to obtain multiple second target mask candidate areas output by the image segmentation model and the second target category text corresponding to each second target mask candidate area.

[0089] Among them, the multiple second target mask candidate regions and the second target category text corresponding to each second target mask candidate region are used to indicate the image segmentation result after the image to be segmented is segmented according to the second target segmentation category and the second target segmentation task.

[0090] Specifically, the image to be segmented, the second target segmentation category, the category conversion relationship, the second target segmentation task, and the task conversion relationship are input into the image segmentation model. The to-be-trained text encoder of the image segmentation model realizes the conversion from the to-be-segmented training category to the second target segmentation category, and the conversion from the to-be-segmented training task to the task of the second target segmentation category according to the second target segmentation category, the category conversion relationship, the second target segmentation task, and the task conversion relationship, and applies the conversion relationship to the calculation process of other models, such as the similarity calculation process. In this way, the image segmentation model can complete the processing of other image segmentation tasks and categories according to the vector relationship between the to-be-segmented training category and other training categories, and the vector relationship between the to-be-segmented training task and other training tasks, avoiding the tedious training process that the model needs to continuously learn different categories of segmentation categories and segmentation tasks, and enhancing the flexibility and learning ability of the model.

[0091] The image segmentation method of the present application obtains an image to be segmented, a first target segmentation category, and a first target segmentation task; the image to be segmented, the first target segmentation category, and the first target segmentation task are input into an image segmentation model, and a plurality of first target mask candidate regions output by the image segmentation model and a first target category text corresponding to each first target mask candidate region are obtained; wherein the image segmentation model is a model trained according to the model training method of any embodiment of the present application, and the plurality of first target mask candidate regions and the first target category text corresponding to each first target mask candidate region are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task. That is, the image segmentation method of the present application can quickly identify and determine the target in the image to be segmented by using the image segmentation model to segment the image to be segmented, thereby improving the efficiency and accuracy of image segmentation.

[0092] Figure 4 is a schematic diagram of the structure of the model training device provided in this application, which is suitable for executing the model training method provided in this application. Figure 4 As shown, the device may specifically include:

[0093] The training acquisition module 401 is used to obtain a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes multiple image training areas and a category label corresponding to each of the image training areas, the first training image is an image to be trained in a training image library, and the training image library includes multiple images to be trained and a training segmentation result of each of the images to be trained.

[0094] The first input module 402 is used to input the first training image, the training category to be segmented and the training task to be segmented into the model to be trained, and obtain multiple mask candidate regions output by the model to be trained and the training category text corresponding to each mask candidate region.

[0095] The adjustment module 403 is used to adjust the model parameters of the model to be trained according to multiple mask candidate regions, the training category text corresponding to each mask candidate region and the training segmentation result to obtain a new model to be trained.

[0096] The model determination module 404 is used to use the second training image as the new first training image, and the training segmentation result of the second training image as the training segmentation result of the new first training image, and return to execute the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation areas, and each of the segmentation areas corresponds to an image category.

[0097] In one embodiment, the model to be trained includes a mask extractor to be trained, a text encoder to be trained, and a segmentation result output unit to be trained. The first input module 402, in the aspect of inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained to obtain multiple mask candidate areas output by the model to be trained and the training category text corresponding to each mask candidate area, is specifically used to: input the first training image into the mask extractor to be trained to obtain multiple mask candidate areas output by the mask extractor to be trained; input the training category to be segmented and the training task to be segmented into the text encoder to obtain the training embedded text output by the text encoder to be trained; wherein the training embedded text is used to indicate the training category to be segmented and the training task to be segmented, and the training category to be segmented includes at least one training category text; input the multiple mask candidate areas and the training embedded text into the segmentation result output unit to be trained to obtain the training category text corresponding to each mask candidate area output by the segmentation result output unit to be trained.

[0098] In one embodiment, the mask extractor to be trained is used to generate the multiple mask candidate areas based on the visual features of multiple objects in the first training image; the text encoder to be trained is used to splice the training categories to be segmented and the training tasks to be segmented to obtain and output the training embedded text; the segmentation result output unit to be trained is used to determine the training category text corresponding to each mask candidate area based on the similarity between the mask candidate area and at least one training category text in the training embedded text.

[0099] In one embodiment, the adjustment module 403 is specifically used to: adjust the model parameters of the mask extractor to be trained according to the multiple mask candidate areas and the image training area to obtain a new mask extractor to be trained; adjust the model parameters of the segmentation result output unit to be trained according to the training category text corresponding to each mask candidate area and the category label corresponding to each image training area to obtain a new segmentation result output unit to be trained; determine the new model to be trained according to the new mask extractor to be trained, the text encoder to be trained and the new segmentation result output unit to be trained.

[0100] In one embodiment, the device also includes: a conversion module, which is used to vectorize the training category to be segmented and the training task to be segmented before the training acquisition module 401 acquires the first training image, the training category to be segmented, the training task to be segmented, and the training segmentation result of the first training image; the first input module 402 is specifically used to input the training category to be segmented and the training task to be segmented into the text encoder to obtain the training embedded text output by the text encoder to be trained, and is used to: input the vector corresponding to the training category to be segmented and the vector corresponding to the training task to be segmented into the text encoder to obtain the training embedded text output by the text encoder to be trained.

[0101] The model training device of the present application, its optional implementation methods and the beneficial effects that can be achieved are the same as those of the above-mentioned model training method embodiment, and will not be repeated here.

[0102] Figure 5 is a structural schematic diagram of an image segmentation device provided by the present application, and the device is suitable for executing the image segmentation method provided by the present application. Figure 5 As shown, the device may specifically include:

[0103] The image acquisition module 501 is used to acquire the image to be segmented, the first target segmentation category and the first target segmentation task.

[0104] A second input module 502 is used to input the image to be segmented, the first target segmentation category and the first target segmentation task into the image segmentation model to obtain multiple first target mask candidate areas output by the image segmentation model and the first target category text corresponding to each first target mask candidate area; wherein the image segmentation model is a model trained according to the model training method described in any embodiment of the present application, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task.

[0105] In one embodiment, the second input module 502 is also used to: after obtaining the multiple target mask candidate areas output by the image segmentation model and the target category text corresponding to each target mask candidate area, obtain the second target segmentation category and the second target segmentation task; perform vectorization conversion on the second target segmentation category and the second target segmentation task; determine the category conversion relationship between the second target segmentation category and the training category to be segmented, and the task conversion relationship between the second target segmentation task and the training task to be segmented according to the vector corresponding to the second target segmentation category, the vector corresponding to the training category to be segmented, the vector corresponding to the second target segmentation task, and the vector corresponding to the training task to be segmented; input the image to be segmented, the second target segmentation category, the category conversion relationship, the second target segmentation task, and the task conversion relationship into the image segmentation model to obtain the multiple second target mask candidate areas output by the image segmentation model and the second target category text corresponding to each second target mask candidate area; wherein the multiple second target mask candidate areas and the second target category text corresponding to each second target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the second target segmentation category and the second target segmentation task.

[0106] The image segmentation device of the present application, its optional implementation methods and the beneficial effects that can be achieved are the same as those of the above-mentioned image segmentation method embodiment, and will not be repeated here.

[0107] The present application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the model training method provided in any one of the above embodiments is implemented, or the image segmentation method provided in any one of the above embodiments is implemented.

[0108] The present application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model training method provided in any of the above embodiments, or implements the image segmentation method provided in any of the above embodiments.

[0109] Reference below Figure 6 , which shows a structural schematic diagram of an electronic device 600 suitable for implementing the present application. Figure 6 The electronic device shown is only an example and should not bring any limitation to the function and scope of use of the present application.

[0110] like Figure 6 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0111] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0112] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present application are executed.

[0113] It should be noted that the computer-readable medium shown in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with 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 above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0114] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the above-mentioned module, program segment or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0115] The modules and / or units described in this application may be implemented in software or hardware. The modules and / or units described may also be provided in a processor, for example, may be described as: a processor including a training acquisition module, a first input module, an adjustment module, and a model determination module. Alternatively, it may be described as: a processor including an image acquisition module and a second input module. The names of these modules do not, in some cases, constitute limitations on the modules themselves.

[0116] As another aspect, the present application further provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes:

[0117] A first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image are obtained; wherein the training segmentation result includes a plurality of image training regions and a category label corresponding to each image training region, the first training image is an image to be trained in a training image library, and the training image library includes a plurality of images to be trained and a training segmentation result of each image to be trained; the first training image, the training category to be segmented, and the training task to be segmented are input into a model to be trained, and a plurality of mask candidate regions output by the model to be trained and a training category text corresponding to each mask candidate region are obtained; according to the plurality of mask candidate regions and the training category text corresponding to each mask candidate region, The model parameters of the model to be trained are adjusted according to the training segmentation result to obtain a new model to be trained; the second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image, and the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" is returned to execute until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation areas, and each segmentation area corresponds to an image category.

[0118] According to the model training method of the present application, a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image are obtained; wherein the training segmentation result includes multiple image training areas and a category label corresponding to each image training area, the first training image is an image to be trained in a training image library, and the training image library includes multiple images to be trained and a training segmentation result of each image to be trained; the first training image, the training category to be segmented, and the training task to be segmented are input into the model to be trained, and multiple mask candidate areas output by the model to be trained and a training category text corresponding to each mask candidate area are obtained; according to the multiple mask candidate areas and the training category text corresponding to each mask candidate area, The training category text and the training segmentation result are used to adjust the model parameters of the model to be trained to obtain a new model to be trained; the second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image, and the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" is returned until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmentation areas, and each segmentation area corresponds to an image category. That is, the model training method of the present application, on the one hand, trains the ability of the model to be trained to segment the image to obtain multiple mask candidate areas, and to match each mask candidate area with the training category to be segmented according to the training task to be segmented, so that the model does not need to be trained one by one according to the characteristics of the target in the image, so that the model can complete the segmentation of multiple targets in the image at one time, reducing the complexity of model training and improving the efficiency of model training. On the other hand, by performing image segmentation on the image to be segmented through the image segmentation model, the target in the image to be segmented can be quickly identified and determined, thereby improving the efficiency and accuracy of image segmentation.

[0119] Alternatively, when the above one or more programs are executed by a device, the device includes:

[0120] Obtain an image to be segmented, a first target segmentation category, and a first target segmentation task; input the image to be segmented, the first target segmentation category, and the first target segmentation task into an image segmentation model, and obtain multiple first target mask candidate areas output by the image segmentation model and a first target category text corresponding to each first target mask candidate area; wherein the image segmentation model is a model trained according to the model training method of any embodiment of the present application, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task.

[0121] According to the image segmentation method of the present application, the image to be segmented, the first target segmentation category and the first target segmentation task are obtained; the image to be segmented, the first target segmentation category and the first target segmentation task are input into the image segmentation model, and multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area output by the image segmentation model are obtained; wherein the image segmentation model is a model trained according to the model training method of any embodiment of the present application, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task. That is, the image segmentation method of the present application can quickly identify and determine the target in the image to be segmented by using the image segmentation model to perform image segmentation on the image to be segmented, thereby improving the efficiency and accuracy of image segmentation.

[0122] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements a model training method as provided in any embodiment of the present application, or implements an image segmentation method as provided in any embodiment of the present application.

[0123] In the process of implementation, the computer program product can be written in one or more programming languages ​​or a combination thereof to perform the computer program code of the present application, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed entirely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer and partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet).

[0124] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.

[0125] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A model training method, characterized in that: include: Obtain a first training image, a training category to be segmented, a training task to be segmented, and a training segmentation result of the first training image; wherein the training segmentation result includes a plurality of image training regions and a category label corresponding to each of the image training regions, the first training image is an image to be trained in a training image library, and the training image library includes a plurality of images to be trained and a training segmentation result of each of the images to be trained; Inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained, and obtaining a plurality of mask candidate regions output by the model to be trained and a training category text corresponding to each mask candidate region; Adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region, and the training segmentation result to obtain a new model to be trained; The second training image is used as the new first training image, and the training segmentation result of the second training image is used as the training segmentation result of the new first training image. Return to execute the step of "inputting the first training image, the training category to be segmented, and the training task to be segmented into the model to be trained" until the preset iteration end condition is reached, and the new model to be trained is used as the image segmentation model; wherein the second training image is an untrained image in the training image library, and the image segmentation model is used to perform image segmentation on the image to be segmented to obtain multiple segmented areas, and each of the segmented areas corresponds to an image category.

2. The method according to claim 1, characterized in that The model to be trained includes a mask extractor to be trained, a text encoder to be trained, and a segmentation result output unit to be trained. The first training image, the training category to be segmented, and the training task to be segmented are input into the model to be trained to obtain multiple mask candidate regions output by the model to be trained and the training category text corresponding to each mask candidate region, including: Inputting the first training image into the mask extractor to be trained to obtain a plurality of mask candidate regions output by the mask extractor to be trained; Inputting the training category to be segmented and the training task to be segmented into the text encoder to be trained to obtain the training embedded text output by the text encoder to be trained; wherein the training embedded text is used to indicate the training category to be segmented and the training task to be segmented, and the training category to be segmented includes at least one training category text; The multiple mask candidate regions and the training embedded text are input into the segmentation result output unit to be trained, and the training category text corresponding to each mask candidate region output by the segmentation result output unit to be trained is obtained.

3. The method according to claim 2, characterized in that The mask extractor to be trained is used to generate the plurality of mask candidate regions according to visual features of the plurality of objects in the first training image; The to-be-trained text encoder is used to concatenate the to-be-segmented training categories and the to-be-segmented training tasks to obtain and output the training embedded text; The to-be-trained segmentation result output unit is used to determine, for each of the mask candidate regions, the training category text corresponding to the mask candidate region according to the similarity between the mask candidate region and at least one training category text in the training embedded text.

4. The method according to claim 3, characterized in that The adjusting the model parameters of the model to be trained according to the multiple mask candidate regions, the training category text corresponding to each mask candidate region and the training segmentation result to obtain a new model to be trained includes: Adjusting the model parameters of the mask extractor to be trained according to the multiple mask candidate regions and the image training region to obtain a new mask extractor to be trained; According to the training category text corresponding to each mask candidate area and the category label corresponding to each image training area, the model parameters of the to-be-trained segmentation result output unit are adjusted to obtain a new to-be-trained segmentation result output unit; The new model to be trained is determined according to the new mask extractor to be trained, the text encoder to be trained and the new segmentation result output unit to be trained.

5. The method according to claim 2, characterized in that: Before obtaining the first training image, the training category to be segmented, the training task to be segmented, and the training segmentation result of the first training image, the method further includes: Performing vectorization conversion on the training categories to be segmented and the training tasks to be segmented; The step of inputting the training category to be segmented and the training task to be segmented into the text encoder to be trained to obtain the training embedded text output by the text encoder to be trained comprises: The vector corresponding to the training category to be segmented and the vector corresponding to the training task to be segmented are input into the text encoder to be trained to obtain the training embedded text output by the text encoder to be trained.

6. An image segmentation method, characterized in that: include: Acquire an image to be segmented, a first target segmentation category, and a first target segmentation task; The image to be segmented, the first target segmentation category and the first target segmentation task are input into an image segmentation model to obtain multiple first target mask candidate areas output by the image segmentation model and the first target category text corresponding to each first target mask candidate area; wherein the image segmentation model is a model trained according to the model training method described in any one of claims 1 to 5, and the multiple first target mask candidate areas and the first target category text corresponding to each first target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the first target segmentation category and the first target segmentation task.

7. The method according to claim 6, characterized in that After obtaining the multiple target mask candidate regions output by the image segmentation model and the target category text corresponding to each target mask candidate region, the method further includes: Obtaining a second target segmentation category and a second target segmentation task; Performing vectorization conversion on the second target segmentation category and the second target segmentation task; Determine a category conversion relationship between the second target segmentation category and the training category to be segmented, and a task conversion relationship between the second target segmentation task and the training task to be segmented, according to the vector corresponding to the second target segmentation category, the vector corresponding to the training category to be segmented, the vector corresponding to the second target segmentation task, and the vector corresponding to the training task to be segmented; The image to be segmented, the second target segmentation category, the category conversion relationship, the second target segmentation task and the task conversion relationship are input into the image segmentation model to obtain multiple second target mask candidate areas output by the image segmentation model and the second target category text corresponding to each second target mask candidate area; wherein the multiple second target mask candidate areas and the second target category text corresponding to each second target mask candidate area are used to indicate the image segmentation result after the image to be segmented is segmented according to the second target segmentation category and the second target segmentation task.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, it implements the model training method as described in any one of claims 1 to 5, or, when executing the program, it implements the image segmentation method as described in claims 6 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the model training method as described in any one of claims 1 to 5 is implemented, or, when the program is executed, the image segmentation method as described in claims 6 to 7 is implemented.

10. A computer program product, comprising a computer program, characterized in that The computer program implements the model training method as described in any one of claims 1 to 5 when executed by a processor, or implements the image segmentation method as described in any one of claims 6 to 7 when executing the program.