Model training method, image segmentation method, electronic device, and medium

By generating multiple training combinations and iteratively optimizing the model training method, the problems of time-consuming parameter tuning and poor results during model training are solved, and the model can be trained quickly and its robustness is improved.

CN116030314BActive Publication Date: 2026-02-27BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111244020.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-25
Publication Date
2026-02-27
Estimated Expiration
2041-10-25

AI Technical Summary

Technical Problem

Parameter tuning during model training is time-consuming and yields uncertain results, making it difficult to achieve optimal performance and affecting the robustness of machine learning.

Method used

By generating multiple different training combinations, the model is pre-trained using the training set and inference set to obtain multiple pre-trained models. The second training data is then determined based on the inference results, and the model is finally iteratively optimized.

Benefits of technology

This enabled rapid training and optimization of the model, improved the robustness of the system, and increased the model's accuracy by approximately 4%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030314B_ABST
    Figure CN116030314B_ABST
Patent Text Reader

Abstract

The application discloses a model training method, an image segmentation method, an electronic device and a medium, comprising: generating a plurality of different training combinations by using first training data, each training combination comprising a training set and an inference set corresponding to the training set; pre-training a first model by using the training set in each of the plurality of different training combinations to obtain a plurality of pre-trained models, wherein each pre-trained model corresponds to a training combination; inputting the inference set in each of the plurality of different training combinations into the corresponding pre-trained model to obtain a plurality of inference results, each inference result corresponding to an inference set; determining second training data by using the plurality of inference results; and training a second model by using the second training data. The application can realize fast training of a model, preferably train an effect, and improve the robustness of a system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application generally relates to the technical field of model training, and particularly relates to a model training method, an image segmentation method, an electronic device and a medium. BACKGROUND

[0002] With the development of artificial intelligence, machine learning models are used more and more widely. In machine learning, model training is needed, and the training result of the model directly affects the final result of machine learning.

[0003] However, when training a model with data, it is often necessary to tune the parameters so that the model learns as much robust feature information as possible in the training data without overfitting, so that reliable results can be inferred during subsequent testing. However, tuning parameters is a time-consuming process, and depending on the level of the person tuning the parameters, the model may not be tuned to the optimal effect. SUMMARY

[0004] In view of the above defects or deficiencies in the prior art, it is desirable to provide a model training method, an image segmentation method, an electronic device and a medium, which can realize fast training of a model, preferably training effect, and improve the robustness of the system.

[0005] In a first aspect, the present application provides a model training method, characterized in that it comprises:

[0006] generating a plurality of different training combinations using first training data, each of the training combinations comprising a training set and an inference set corresponding to the training set;

[0007] pre-training a first model using the training sets in the plurality of different training combinations respectively, to obtain a plurality of pre-trained models, wherein each of the pre-trained models corresponds to one of the training combinations;

[0008] inputting the inference sets in the plurality of different training combinations into the corresponding pre-trained models respectively, to obtain a plurality of inference results, each of the inference results corresponding to one of the training combinations;

[0009] determining second training data through the plurality of inference results;

[0010] training a second model using the second training data.

[0011] Optionally, the first training data comprises a plurality of training samples, wherein,

[0012] generating a plurality of different training combinations using first training data, each of the training combinations comprising a training set and an inference set corresponding to the training set, the method comprising:

[0013] randomly dividing all the training samples in the first training data into a plurality of sample subsets, the number of training samples in each of the sample subsets being the same;

[0014] selecting at least one of the sample subsets in the first training data randomly as the training set, and the union of the remaining sample subsets as the inference set;

[0015] repeating the random selection multiple times until a plurality of different training combinations are generated.

[0016] Optionally, the pre-training method comprises:

[0017] for a model object to be pre-trained, determining the training set in the training combination corresponding to the model object;

[0018] based on the training set, constructing a pre-training sample set;

[0019] training the model object using the pre-training sample set.

[0020] Optionally, the method of constructing a pre-training sample set based on the training set comprises:

[0021] selecting part of the samples in the training set as the pre-training sample set, and the remaining samples as a pre-training validation set, the pre-training validation set being used to evaluate the pre-trained model object to obtain an evaluation result corresponding to the pre-trained model object.

[0022] Optionally, the second training data is determined through a plurality of inference results, comprising:

[0023] iteratively performing at least one pre-training using the inference results;

[0024] determining the second training data based on the plurality of inference results after the final iteration.

[0025] Further, the method of iteratively performing at least one pre-training using the inference results comprises:

[0026] updating the first training data through the inference results;

[0027] performing pre-training using the updated first training data to obtain a plurality of pre-trained models after this pre-training and a plurality of inference results after this pre-training;

[0028] iteratively performing pre-training until a set number of iterations is completed to obtain a plurality of pre-trained models after the final iteration and a plurality of inference results after the final iteration.

[0029] Further, the method further comprises:

[0030] obtaining evaluation results of the pre-training models in the last iteration pre-training;

[0031] updating a model object in the current iteration pre-training based on the evaluation results, wherein the model object in the current iteration pre-training is a first optimal model in the pre-trained models in the last iteration pre-training, and the first optimal model is a pre-training model with the optimal evaluation result in the last iteration.

[0032] Optionally, the second model is the same as the first model.

[0033] Optionally, the second model is a second optimal model in the pre-trained first training models, wherein the second optimal model is a corresponding first training model with the optimal evaluation result.

[0034] In a second 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, characterized in that the processor executes the following method:

[0035] generating a plurality of different training combinations using the first training data, each of the training combinations comprising a training set and an inference set corresponding to the training set;

[0036] pre-training a first model using the training sets in the plurality of different training combinations respectively, to obtain a plurality of pre-training models, wherein each of the pre-training models corresponds to one of the training combinations;

[0037] inputting the inference sets in the plurality of different training combinations into the corresponding pre-training models respectively, to obtain a plurality of inference results, each of the inference results corresponding to one of the training combinations;

[0038] determining second training data through the plurality of inference results;

[0039] training a second model using the second training data.

[0040] In a third aspect, the present application provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, is configured to execute the method of any one of the above aspects.

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

[0042] obtaining an image to be segmented;

[0043] input the image to be segmented into an image segmentation model to obtain a target segmentation result of the image to be segmented, wherein the image segmentation model is obtained by the method in any one of the preceding aspects.

[0044] In an embodiment of the present application, the image to be segmented is input into an image segmentation model to obtain a target segmentation result of the image to be segmented, and the method comprises:

[0045] inputting the image to be segmented into a pre-trained optimal model to obtain a first segmentation result of the image to be segmented, wherein the optimal model is a corresponding first training model whose evaluation result is optimal among the first training models;

[0046] inputting the first segmentation result into the image segmentation model to obtain a target segmentation result of the image to be segmented.

[0047] In an embodiment of the present application, before the first segmentation result is input into the image segmentation model, the method further comprises:

[0048] iteratively inputting the first segmentation result into a pre-trained optimal model of each iteration.

[0049] 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, characterized in that the processor is configured to execute the following method:

[0050] obtaining an image to be segmented;

[0051] inputting the image to be segmented into an image segmentation model to obtain a target segmentation result of the image to be segmented, wherein the image segmentation model is obtained by the method in any one of the preceding aspects.

[0052] In a sixth aspect, the present application provides a computer readable storage medium, wherein the computer instructions are configured to execute the method in any one of the preceding aspects.

[0053] The technical scheme provided by the embodiments of the present application can have the following beneficial effects:

[0054] The model training method and device, image segmentation method and device, and medium provided by the embodiments of the present application can realize rapid training of the model, preferably training effect, and improve the robustness of the system by selecting and combining data, iteratively pre-training, obtaining a plurality of pre-training models, and establishing an inference set to obtain a data set for model training. BRIEF DESCRIPTION OF DRAWINGS

[0055] Other features, objects, and advantages of the application will become more apparent from the following detailed description when read in conjunction with the accompanying drawings:

[0056] Figure 1 A flow chart of a model training method provided for an embodiment of the application;

[0057] Figure 2 A flow chart of a training combination generation method provided for an embodiment of the application;

[0058] Figure 3 A schematic diagram of a principle of a model training method provided for an embodiment of the application;

[0059] Figure 4 A flow chart of an image segmentation method provided for an embodiment of the application;

[0060] Figure 5 A schematic diagram of a UNet network structure provided for an embodiment of the application;

[0061] Figure 6 A schematic diagram of a principle of an image segmentation method provided for an embodiment of the application;

[0062] Figure 7 A structural schematic diagram of an electronic device provided for an embodiment of the application. DETAILED DESCRIPTION

[0063] The application will be further described below in conjunction with the drawings and embodiments. It can be understood that the specific embodiments described herein are only used to explain the related application, and not to limit the application. In addition, it should be noted that only the parts related to the application are shown in the drawings for ease of description.

[0064] It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0065] Please see Figure 1 A model training method comprises:

[0066] Step S01, generating a plurality of different training combinations by using first training data, each of the training combinations comprising a training set and an inference set corresponding to the training set.

[0067] Step S02, pre-training a first model by using the training sets in the plurality of different training combinations respectively, to obtain a plurality of pre-trained models, wherein each of the pre-trained models corresponds to one of the training combinations.

[0068] Step S03, inputting the inference set in each of the plurality of different training combinations into the corresponding pre-trained model respectively to obtain a plurality of inference results, each of the inference results corresponding to one of the training combinations.

[0069] Step S04, determining second training data through the plurality of inference results.

[0070] Step S05, training a second model by using the second training data.

[0071] In the embodiments of the present application, the model to be trained can be a machine learning model, including but not limited to a traditional machine learning model, a neural network model, etc. For example, the neural network can adopt various common neural network architectures such as a convolutional neural network (CNN), a deep neural network (DNN), a recurrent neural network (RNN), an auto-encoding neural network (AENN), a sparse auto-encoding machine (SAE), or a neural network product implemented based on a common neural network architecture, such as AlexNet, VGGNet, Google Inception Net, ResNet, etc. The neural network structure can also be designed according to the principle of the neural network.

[0072] In the following embodiments of the present application, a neural network adopting UNet is exemplarily described. In the embodiments of the present application, the first model is a basic model of UNet to be pre-trained, and the second model can be the same basic model as the first model, or can be a pre-trained network model, which is not limited in the embodiments of the present application. The selection of the second model is described in detail in the following different embodiments.

[0073] The first training data includes a plurality of training samples. In the embodiments of the present application, when different training combinations are generated, a certain number of training sets can be randomly selected from all training samples, and the remaining training samples are used as a validation set. n training sets and n validation sets are obtained by selecting n times. Alternatively, all training samples can be divided into m sample subsets, and the m sample subsets are combined to obtain n training sets and n validation sets.

[0074] In the present application, it is extremely necessary to perform data splitting and combination on the first training data. If n in the data splitting becomes 1, all training sets are used to train a model in the pre-training, and then the training set is inferred. The accuracy of the inference result is very high, but such inference accuracy has no practical significance. Because at this time, the annotations in the training set and the validation set are very similar (even the texture is consistent), as long as the inconsistent places are supplemented and the redundancy is removed, the accuracy will be abnormally increased a lot, which is a serious overfitting at this time.

[0075] Split the data into multiple parts, train the model with (n-1) parts of data, and infer with 1 part of data. The inference result is different from the validation set, which can show the robustness of the features learned by the model.

[0076] Finally, the inference results of such n validation data are combined as the final training set of the model. The training set and the validation set are different and not highly correlated at this time. The trained model is robust, and the accuracy will be about 4% higher than before when loading the pre-trained model as a pre-trained model.

[0077] It should be noted that in the application embodiment, the generation method of the training set and the validation set is not limited, and different methods can be used in different model training processes. For example, in the case of large training sample data, the direct selection method can be used, and in the case of small sample data, the sample subset is divided first, and the sample amount is increased by the data combination method of the sample subset. In the application embodiment, the sample subset is divided for example. The principles of the two are similar, and the application does not repeat the direct random selection method.

[0078] In step S01 of the application, multiple different training combinations are generated using the first training data, each of which includes a training set and an inference set corresponding to the training set. The method includes, as shown in Figure 2

[0079] S11, randomly divide all the training samples in the first training data into multiple sample subsets, and the number of training samples in each sample subset is the same.

[0080] S12, randomly select at least one sample subset in the first training data as the training set, and the union of the remaining sample subsets as the inference set.

[0081] S13, repeat the random selection multiple times until multiple different training combinations are generated.

[0082] It should be noted that in the application embodiment, in order to balance the training result, the training data in each sample subset is averaged, that is, the first training data is evenly divided into multiple sample subsets, for example, the embodiment divides the total sample into five sample subsets, which are respectively denoted as data sample subsets p1, p2, p3, p4, and p5. In the five data sample subsets, four subsets are randomly selected as the training set, and the remaining one subset is used as the inference set. Of course, in other embodiments, other allocation combination methods can also be used, and the application is not limited.

[0083] ​In the embodiments of the present application, the number of generated training combinations is related to the number of models to be pre-trained, for example, 5 pre-training models need to be pre-trained, and 5 training combinations are generated. Different numbers of pre-training models can be generated in different application scenarios. The number of pre-training models also has a certain relationship with the number of samples. Too many models will increase the amount of calculation. In different applications, the number of models can be selected according to the requirements.

[0084] The same extraction method is repeatedly performed n times to generate n training sets and n verification sets, denoted as training set 1, inference set 1, inference set 2, inference set 2, …, inference set n, inference set n.

[0085] For example, as shown in Figure 3 , the extraction is repeated 5 times to generate:

[0086] Training set 1 (p1, p2, p3, p4), corresponding inference set 1 (p5);

[0087] Training set 2 (p1, p2, p3, p5), corresponding inference set 2 (p4);

[0088] Training set 3 (p1, p2, p4, p5), corresponding inference set 3 (p4);

[0089] Training set 4 (p1, p3, p4, p5), corresponding inference set 4 (p2);

[0090] Training set 5 (p2, p3, p4, p5), corresponding inference set 5 (p1).

[0091] It should be noted that in the embodiments of the present application, the training set is constructed for model training, and the inference set is not used to verify the result of the training model. Unlike the verification set in the pre-training process, the inference set in the embodiments of the present application is similar to data preprocessing, that is, it is used to generate a data set in the final model training. In the present application, the data preprocessing method of the inference set is obtained by the model pre-trained by the present application. In this way, the accuracy of the model can be effectively improved.

[0092] It should be noted that the training combination generated in the embodiments of the present application is in the form of Of course, there are different data combination methods under different division methods. The present application can generate data combinations in various ways. The number of pre-trained models or the number of samples can be selected based on different requirements.

[0093] In the step S02, the pre-training method comprises:

[0094] For the model object to be pre-trained, the training set in the corresponding training combination is determined; based on the training set, a pre-training sample set is constructed; and the model object is trained using the pre-training sample set.

[0095] It is worth noting that in the embodiments of the present application, one model object is trained in one pre-training of one training combination. In the following, each training combination is used to train one model object in each iteration. In each iteration of the pre-training process, the model objects in each iteration can be the same or different, and each model object in each iteration can also be the same or different. When training, the training combination corresponding to the model object is determined.

[0096] For example, the UNet base model (first model) is trained by the training set 1 (p1, p2, p3, p4) to obtain model 1;

[0097] The UNet base model (first model) is trained by the training set 2 (p1, p2, p3, p5) to obtain model 2;

[0098] The UNet base model (first model) is trained by the training set 3 (p1, p2, p4, p5) to obtain model 3;

[0099] The UNet base model (first model) is trained by the training set 4 (p1, p3, p4, p5) to obtain model 4;

[0100] The UNet base model (first model) is trained by the training set 5 (p2, p3, p4, p5) to obtain model 5.

[0101] It should be noted that in step S22, the pre-training sample set is constructed based on the training set, and the method comprises: selecting part of the samples in the training set as the pre-training sample set, and the remaining samples as a pre-training validation set, the pre-training validation set is used to evaluate the pre-trained model object to obtain the evaluation result corresponding to the pre-trained model object.

[0102] In the pre-training process in the embodiments of the present application, a plurality of parallel network architectures are used, wherein the network architecture comprises a plurality of parallel sub-networks, each sub-network is used to generate a pre-training model, and the input end of each sub-network is a training set. The base network model of each sub-network can use the same model, but the input end of each input end in the network architecture is a different training sample set.

[0103] It should be noted that when the model is trained, the way of selecting the pre-training sample set and the pre-training verification set from the training set is not limited, for example, 80% of the training set can be used as the pre-training sample set and the remaining 20% can be used as the pre-training verification set. The construction method in the present application is only exemplary. Different settings can be made in different embodiments. When each training set is used to pre-train the corresponding model object, the same selection standard can be used to balance the fitting problem caused by the imbalance in the training process.

[0104] It should be noted that the present embodiment is not limited to the specific method of model training, such as logistic regression training or deep neural network training, and the process of model training is the process of training model parameters, which will not be described here.

[0105] In the embodiments of the present application, the model evaluation is usually evaluated according to the ROC curve, for example, according to the accuracy, sensitivity or AUC, wherein the AUC is the area under the ROC curve. The better the performance of the model, the closer the ROC curve to the left and upper, and the area under it (AUC) should be larger. The prediction effect of a model can be evaluated according to the value of AUC.

[0106] In the embodiments of the present application, the evaluation effect of each model is obtained by the verification set. On the one hand, it can be used to generate the next step of the to-be-trained model, which includes the pre-trained model object in the iterative pre-training and the final pre-trained second model. In the embodiments of the present application, by evaluating the model, it can also be used for application when processing the to-be-processed data, and the final optimal processing result can be obtained by processing the data layer by layer.

[0107] In step S03, the inference set needs to be input into the pre-trained model generated by the corresponding same training combination to obtain the inference result. By using each training sample of one training combination in the present application to complete the application of the same pre-trained model, each pre-trained model obtained in parallel is applied to each training sample in the first training data. Therefore, the technical scheme of the present application can realize the balance of each pre-training branch, and adjust the parameters to make the model learn as much robust feature information as possible in the training data without overfitting, so that reliable results can be inferred in subsequent testing.

[0108] In addition, in step S04, the second training data is determined by the plurality of inference results, including:

[0109] Using the inference result, iteratively pre-training at least once.

[0110] In step S41, specifically including:

[0111] S401, updating the first training data according to the inference result.

[0112] S402, pre-training using the updated first training data, obtaining a plurality of pre-trained models and a plurality of inference results of this pre-training.

[0113] S403, repeating steps S401 and S402, iteratively pre-training until a preset number of iterations is completed, obtaining a plurality of pre-trained models of the final iteration and a plurality of inference results of the final iteration.

[0114] It should be noted that in the embodiments of the present application, after one pre-training, the data set used for pre-training each time is generated by the inference result obtained by the previous iteration. By performing the same processing as steps S01-S02 on the data set, the pre-training is completed, and the data set used for the next iteration is obtained by step S03. Repeat the above steps until the preset number of iterations is completed.

[0115] S42, determining the second training data based on the plurality of inference results after the final iteration.

[0116] In addition, it should be noted that in the embodiments of the present application, the number of iterations of pre-training is not limited, but in specific applications, it is generally limited to 3-4 iterations, preferably 2-3 iterations. If too many iterations are used, overfitting problems may occur, resulting in decreased prediction accuracy and affecting the robustness of the system.

[0117] In step S402, during the iterative pre-processing, the model object used in the parallel network architecture is the same object in each iteration, but the model object used in different iterations is different. In specific applications, it can include:

[0118] S411, obtaining the evaluation result of each pre-trained model in the last iteration pre-training;

[0119] S412, updating the model object in the current iteration pre-training based on the evaluation result, wherein the model object in the current iteration pre-training is the first optimal model in the pre-trained model of the last iteration pre-training, and the first optimal model is the pre-trained model with the optimal evaluation result in the last iteration.

[0120] By using the optimized model updated in each iteration in the process of each iteration, the training effect of the model can be improved.

[0121] In an embodiment of the present application, the second model in step S05 is the same as the first model.

[0122] In another embodiment of the present application, in step S05, the second model is a second optimal model in each of the pre-trained first training models, wherein the second optimal model is a corresponding first training model whose evaluation result is optimal.

[0123] The second model can be an optimized model updated by successive iterations, which can improve the training effect of the model. Of course, the type of the second model is not limited in the embodiments of the present application. The basic model (first model) can be used for fast response with short time consumption, and the optimized model can improve the training effect of the model.

[0124] An image is the most commonly used information carrier in human social activities, which can provide a large amount of information about the described object. The image processing method can include image recognition, image segmentation, image feature extraction, image classification, etc. The model training method in the embodiments of the present application can be used for training of image recognition models, image segmentation models, image feature extraction models, image classification models, etc. Of course, the present application can also be used for training methods of speech, text and other processing models. The embodiments of the present application exemplarily illustrate a method of image segmentation using a trained image segmentation model.

[0125] Please refer to Figure 4 The present application provides an image segmentation method, which comprises:

[0126] S100, acquiring an image to be segmented;

[0127] S200, inputting the image to be segmented into an image segmentation model to obtain a target segmentation result of the image to be segmented, wherein the image segmentation model is trained by any of the above methods.

[0128] In the embodiments of the present application, the method of image training can be supervised, for example, the test set can be input into the pre-trained model after training, and the evaluation index value can be calculated according to the prediction result of the output of the pre-trained model after training and the true label of the test set. If the evaluation index value meets the index threshold in the training end condition, it means that the test result of the pre-trained model after training meets the training end condition, and the pre-training of the model is completed.

[0129] In the embodiments of the present application, the image can be a grayscale image or an RGB image. The type of the image is not limited in the embodiments of the present application, and the image can also be other preprocessed images. The preprocessing methods include but are not limited to color transformation. In addition to the color disturbance shown in the embodiments of the present application, the methods also include contrast transformation, noise disturbance, etc. It also includes image rotation translation, random pruning, translation transformation, scale transformation, etc.

[0130] In the embodiment of the present application, the basic model (first model) adopted by the network architecture is a UNet model. The UNet network is an image segmentation network, which is originally applied to medical image segmentation. It performs 4 times of downsampling and 4 times of upsampling, and performs multi-scale fusion during upsampling, so that the obtained segmentation result is relatively accurate. The UNet network reduces the feature resolution through continuous pooling operations and convolution operations. Figure 5 A schematic diagram of a UNet network structure is shown in FIG. 1, but the present application is not limited thereto. As the model to be trained, any model in the prior art can be used.

[0131] In step S200, the image to be segmented is input into the image segmentation model to obtain the target segmentation result of the image to be segmented. The method comprises the following steps.

[0132] The image to be segmented is input into the pre-trained optimal model to obtain the first segmentation result of the image to be segmented. The optimal model is the first training model corresponding to the one whose evaluation result is optimal. Figure 6 As shown in FIG. 2.

[0133] The first segmentation result is input into the image segmentation model to obtain the target segmentation result of the image to be segmented.

[0134] In an embodiment of the present application, if multiple iteration pre-training is performed in the training model, before the first segmentation result is input into the image segmentation model in step S200, the method further comprises the following steps.

[0135] The first segmentation result is input into the optimal model pre-trained in each iteration.

[0136] It should be noted that in the embodiment of the present application, during the process of segmenting the image, the image to be segmented can be iteratively input into multiple optimal models in the pre-training model process of the present application. Through the iterative input mode, the image segmentation effect can be improved, and the segmentation accuracy can be improved.

[0137] The execution subject of the model training method of the embodiment is a model training device. The model training device can be realized by software and / or hardware. The model training device in this embodiment can be configured in an electronic device or a server for controlling the electronic device. The server communicates with the electronic device and controls it.

[0138] In the embodiment, the electronic device can include but is not limited to personal computers, platform computers, smart phones, smart speakers, and the like. The electronic device is not limited in this embodiment.

[0139] The electronic device 900 of the embodiment, as shown in FIG. 9,Figure 7 As shown, comprising a processor and a memory, the processor and the memory are connected with each other, wherein the memory is configured to store a computer program, the computer program comprises program instructions, the processor is configured to invoke the program instructions to execute the model training method according to any one of the above or the image segmentation method.

[0140] The flowcharts and block diagrams in the drawings illustrate the possible implementation architecture, function and operation instruction of the system, method and computer program product according to various embodiments of the present application. In this regard, each block in the flowcharts or block diagrams can represent a module, a program segment or a part of code, and the aforementioned module, program segment or part of code comprises one or more executable instructions for implementing the specified logic function. It should also be noted that in some alternative implementations, the functions annotated in the blocks can also occur in different order from that annotated in the drawings. For example, two connected blocks can actually be executed substantially in parallel, and sometimes they can be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and the combination of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or operation instructions, or can be implemented by a combination of dedicated hardware and computer instructions. The above description is only for the preferred embodiments of the present application and the explanation of the applied technical principles. Those skilled in the art should understand that the disclosed scope of the present application is not limited to the technical solutions formed by the specific combination of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the disclosed concept. For example, the above features can be replaced with the technical features disclosed in the present application (but not limited to) having similar functions to form technical solutions.

[0141] In the embodiments of the present application, the processor is a processing device with logical operation execution capability, such as a central processing unit (CPU), a field programmable logic array (FPGA), a digital signal processor (DSP), a single-chip microcomputer (MCU), an application specific logic circuit (ASIC), a graphics processing unit (GPU), and the like. It is easy to understand that the processor is usually communicatively connected to a memory, and stores any combination of one or more computer program products on the memory. The memory can include various forms of computer readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include random access memory (RAM) and / or cache memory, and the like. The non-volatile memory may, for example, include read only memory (ROM), a hard disk, erasable programmable read only memory (EPROM), a USB memory, a flash memory, and the like. One or more computer instructions can be stored on the memory, and the processor can execute the computer instructions to implement the related analysis functions. Various application programs and various data, such as various data used and / or generated by the application programs, and the like, can also be stored in the computer readable storage medium.

[0142] In the embodiments of the present application, each module can be implemented by the processor executing related computer instructions, for example, the image processing module can be implemented by the processor executing instructions of an image transformation algorithm, the machine learning module can be implemented by the processor executing instructions of a machine learning algorithm, and the neural network can be implemented by the processor executing instructions of a neural network algorithm.

[0143] In the embodiments of the present application, each module can run on the same processor or multiple processors, and can run on the same architecture processor or different architecture processors. For example, the image processing module runs on an X86 system CPU, and the machine learning module runs on a GPU. Each module can be packaged in one computer product, such as being packaged in one computer software and running on one computer (server), or can be packaged separately or partially in different computer products, such as being packaged in one computer software and running on one computer (server), and the machine learning module being packaged in separate computer software and running on another computer (server) or multiple computers (servers). The computing platform when each module executes can be local computing, cloud computing, or a hybrid of local computing and cloud computing.

[0144] The computer system includes a central processing unit (CPU) 901, which performs various appropriate actions and processes based on programs stored in read-only memory (ROM) 902 or programs loaded from storage section 908 into random access memory (RAM) 903. RAM 903 also stores various programs and data required for the system's operating instructions. CPU 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.

[0145] The following components are connected to I / O interface 905: an input section 906 including a keyboard, mouse, etc.; an output section 907 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 908 including a hard disk, etc.; and a communication section 909 including a network interface card such as a LAN card, modem, etc. The communication section 909 performs communication processing via a network such as the Internet. A drive 910 is also connected to I / O interface 905 as needed. A removable medium 911, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 910 as needed so that computer programs read from it can be installed into storage section 908 as needed.

[0146] Specifically, according to embodiments of this application, the flowchart above refers to... Figure 1 The described process can be implemented as a computer software program. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. In such an embodiment, the computer program contains program code for performing the methods shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via communication section 909, and / or installed from removable medium 911. When the computer program is executed by central processing unit (CPU) 901, it performs the functions defined in the system of this application.

[0147] The electronic device provided in this application embodiment is provided with a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, which is executed by a processor to implement the method as described in any of the above.

[0148] It should be noted that the computer-readable medium in the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or component, or any combination thereof. More specific examples of computer-readable storage media can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, 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, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or component. In the present application, the computer-readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, which carries computer-readable program code. Such a propagated data signal can take various forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium that can send, propagate or transmit a program for use by or in conjunction with an instruction execution system, device or component. The program code contained in the computer-readable medium can be transmitted by any suitable medium, including but not limited to wireless, wire, optical cable, RF, etc., or any suitable combination thereof.

[0149] It should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present application and simplifying the description, and do not indicate or imply that the devices or elements referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present application.

[0150] In addition, the terms "first" and "second" are only for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features referred to. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise specifically limited.

[0151] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. As used herein, the terms "on", "above", "under", "below", "up", "down", "right", "left" and the like are intended to indicate relative positions and orientations, and are not intended to indicate absolute positions and orientations. As used herein, the terms "set" and the like can mean that a component is directly attached to another component, or that a component is attached to another component through an intermediate component. The features described in one embodiment herein can be applied to another embodiment, either individually or in combination, unless the features are not applicable or are otherwise stated.

[0152] The present application has been described through the above embodiments, but it should be understood that the above embodiments are only for the purpose of illustration and description, and are not intended to limit the present application to the scope of the described embodiments. Those skilled in the art can understand that more variations and modifications can be made according to the teachings of the present application, and these variations and modifications all fall within the scope of the present application.

Claims

1. An image segmentation method characterized by, The method comprises: obtaining an image to be segmented; inputting the image to be segmented into an image segmentation model to obtain a target segmentation result of the image to be segmented, wherein the training method of the image segmentation model comprises: generating a plurality of different training combinations using first training data, each training combination comprising a training set and an inference set corresponding to the training set; pre-training a first model using the training set in each of the plurality of different training combinations to obtain a plurality of pre-trained models, wherein each pre-trained model corresponds to a training combination; inputting the inference set in each of the plurality of different training combinations into the corresponding pre-trained model to obtain a plurality of inference results, each inference result corresponding to a training combination; determining second training data based on the plurality of inference results; training a second model using the second training data, wherein the second model is the first model, or the second model is a second optimal model among the pre-trained first models, and the second optimal model is the first model with the optimal evaluation result.

2. The image segmentation method of claim 1, wherein, The first training data comprises a plurality of training samples, wherein the method for generating a plurality of different training combinations using first training data comprises: randomly dividing all the training samples in the first training data into a plurality of sample subsets, and the number of training samples in each sample subset is the same; randomly selecting at least one sample subset in the first training data as the training set, and the union of the remaining sample subsets as the inference set; repeating the random selection multiple times until a plurality of different training combinations are generated.

3. The image segmentation method of claim 1, wherein, The pre-training method comprises: determining the training set in the corresponding training combination for the model object to be pre-trained; constructing a pre-training sample set based on the training set; training the model object using the pre-training sample set.

4. The image segmentation method of claim 3, wherein, The method for constructing a pre-training sample set based on the training set comprises: selecting part of the samples in the training set as the pre-training sample set, and the remaining samples as a pre-training validation set, wherein the pre-training validation set is used to evaluate the pre-trained model object to obtain the evaluation result corresponding to the pre-trained model object.

5. The image segmentation method of claim 1, wherein, The method for determining second training data based on the plurality of inference results comprises: iteratively performing at least one pre-training using the inference results; determining second training data based on the plurality of inference results after the final iteration.

6. The image segmentation method of claim 5, wherein, The method for iteratively performing at least one pre-training using the inference results comprises: updating the first training data based on the inference results; pre-training using the updated first training data to obtain a plurality of pre-trained models and a plurality of inference results in this iteration; iteratively pre-training until a set number of iterations is completed to obtain a plurality of pre-trained models after the final iteration and a plurality of inference results after the final iteration.

7. The image segmentation method of claim 5, wherein, The method further comprises: obtaining the evaluation results of the pre-trained models in the previous iteration; Based on the evaluation result, the model object in the current iteration pre-training is updated, wherein the model object in the current iteration pre-training is a first optimal model in the pre-trained model pre-trained in the last iteration, and the first optimal model is a pre-trained model with the optimal evaluation result in the last iteration.

8. The image segmentation method of claim 1, wherein, The method comprises: The first segmentation result is input into the image segmentation model to obtain a target segmentation result of the image to be segmented. The first segmentation result is input into the image segmentation model to obtain a target segmentation result of the image to be segmented.

9. The image segmentation method of claim 8, wherein, Before the first segmentation result is input into the image segmentation model, the method further comprises: The first segmentation result is iteratively input into the optimal model pre-trained in each iteration.

10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor is configured to execute the following method: An image to be segmented is obtained. The image to be segmented is input into an image segmentation model to obtain a target segmentation result of the image to be segmented. The training method of the image segmentation model comprises: A plurality of different training combinations are generated by using first training data, each training combination comprising a training set and an inference set corresponding to the training set; A plurality of pre-trained models are obtained by pre-training a first model by using the training sets in the plurality of different training combinations respectively, wherein each pre-trained model corresponds to a training combination; A plurality of inference results are obtained by inputting the inference sets in the plurality of different training combinations into the corresponding pre-trained models respectively, each inference result corresponding to a training combination; Second training data is determined through the plurality of inference results; A second model is trained by using the second training data, wherein the second model is the first model, or the second model is a second optimal model in the pre-trained first models, wherein the second optimal model is a corresponding first model with the optimal evaluation result among the first models.

11. The electronic device of claim 10, wherein, The processor is further configured to execute: All training samples in the first training data are randomly divided into a plurality of sample subsets, and the number of training samples in each sample subset is the same; At least one sample subset in the first training data is randomly selected as the training set, and the union of the remaining sample subsets is taken as the inference set; The random selection is repeated for multiple times until a plurality of different training combinations are generated.

12. The electronic device of claim 10, wherein, The processor is further configured to execute: At least one pre-training is iteratively performed by using the inference result; Second training data is determined based on the plurality of inference results after the final iteration.

13. The electronic device of claim 12, wherein, The processor is further configured to execute: An evaluation result of each pre-trained model in the last iteration pre-training is obtained; Based on the evaluation result, the model object in the current iteration pre-training is updated, wherein the model object in the current iteration pre-training is a first optimal model in the pre-trained model pre-trained in the last iteration, and the first optimal model is a pre-trained model with the optimal evaluation result in the last iteration.

14. The electronic device of claim 10, wherein, The processor is further configured to perform: inputting the image to be segmented into a pre-trained optimal model to obtain a first segmentation result of the image to be segmented, the optimal model being a corresponding first model whose evaluation result is optimal among the first models; inputting the first segmentation result into the image segmentation model to obtain a target segmentation result of the image to be segmented.

15. The electronic device of claim 14, wherein, The processor is further configured to perform: before inputting the first segmentation result into the image segmentation model, iteratively inputting the first segmentation result into a pre-trained optimal model of each iteration.

16. A computer-readable storage medium, characterized in that, A computer program is stored thereon, which is executed by a processor to perform the method of any one of claims 1-9.

Citation Information

Patent Citations

  • Multi-sampling model training method and device

    CN107133436A

  • Model optimization method and device based on scene adaptation

    CN109657799A