Image segmentation model acquisition method, device, and storage medium
Patent Information
- Application Number
- CN202310308139.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-17
- Publication Date
- 2026-09-22
- Estimated Expiration
- 2043-03-17
AI Technical Summary
并且,模型的运行需要先部署到到硬件中时,过小的图像分割模型不能充分利用硬件算力,造成资源浪费,过大的图像分割模型无法与硬件算力匹配,导致图像分割模型的实用性下降
[0014]本申请提供一种图像分割模型的获取方法、设备及存储介质,本申请的图像分割模型的获取方法包括:获取图像分割需求和应用平台的硬件参数;基于所述图像分割需求和所述硬件参数确定目标图像分割模型的计算量范围;根据所述计算量范围在预设搜索空间进行搜索,得到所述计算量范围内的多个候选图像分割模型;获取所述多个候选图像分割模型的评价参数;基于所述多个候选图像分割模型的评价参数和所述图像分割需求,筛选所述多个候选图像分割模型,确定所述目标图像分割模型。旨在根据应用平台的硬件条件和图像分割需求得到多个候选图像分割模型,再根据图像分割需求从多个候选图像分割模型中进一步筛选确定目标图像分割模型,实现了硬件资源的合理配置,高度契合用户的图像分割需求,有效地提高了模型获取的准确性和用户的体验度。
Smart Images

Figure CN116485805B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to a method, device and storage medium for obtaining an image segmentation model. Background Technology
[0002] Currently, with the development of artificial intelligence technology, image segmentation has been widely applied in various scenarios, such as smart healthcare, bioinformatics, autonomous driving, and industrial engineering. Different application scenarios often correspond to different image segmentation requirements. For example, medical imaging scenarios have extremely high accuracy requirements but relatively low speed requirements, while face detection scenarios do not have high accuracy requirements but require rapid recognition. Furthermore, when the model needs to be deployed to hardware before it can run, an image segmentation model that is too small cannot fully utilize the hardware's computing power, resulting in wasted resources, while an image segmentation model that is too large cannot match the hardware's computing power, leading to a decrease in the model's practicality. How to balance image segmentation requirements and hardware resource configuration, and efficiently select an appropriate image segmentation model, is an urgent problem to be solved. Summary of the Invention
[0003] The main objective of this application is to provide a method, device, and storage medium for obtaining image segmentation models. The aim is to obtain multiple candidate image segmentation models based on the hardware conditions of the application platform and the image segmentation requirements, and then further select the target image segmentation model from the multiple candidate image segmentation models according to the image segmentation requirements. This achieves reasonable allocation of hardware resources, highly meets the user's image segmentation needs, and effectively improves the accuracy of model acquisition and the user experience.
[0004] In a first aspect, this application provides a method for obtaining an image segmentation model, the method comprising:
[0005] Obtain the image segmentation requirements and the hardware parameters of the application platform;
[0006] The computational complexity range of the target image segmentation model is determined based on the image segmentation requirements and the hardware parameters.
[0007] Based on the computational complexity range, a search is performed in a preset search space to obtain multiple candidate image segmentation models within the computational complexity range;
[0008] Obtain the evaluation parameters of the multiple candidate image segmentation models;
[0009] Based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements, the multiple candidate image segmentation models are screened to determine the target image segmentation model.
[0010] Secondly, this application also provides a computer device, which includes a memory and a processor;
[0011] The memory is used to store computer programs;
[0012] The processor is configured to execute the computer program and, when executing the computer program, implement the image segmentation model acquisition method provided in any of the embodiments of this application.
[0013] Thirdly, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to implement the image segmentation model acquisition method provided in any of the embodiments of this application.
[0014] This application provides a method, device, and storage medium for obtaining an image segmentation model. The method includes: obtaining image segmentation requirements and hardware parameters of the application platform; determining the computational complexity range of the target image segmentation model based on the image segmentation requirements and hardware parameters; searching within a preset search space according to the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range; obtaining evaluation parameters of the multiple candidate image segmentation models; and filtering the multiple candidate image segmentation models based on the evaluation parameters and the image segmentation requirements to determine the target image segmentation model. This method aims to obtain multiple candidate image segmentation models based on the hardware conditions of the application platform and image segmentation requirements, and then further filter and determine the target image segmentation model from these candidates according to the image segmentation requirements. This achieves reasonable allocation of hardware resources, highly matches the user's image segmentation needs, and effectively improves the accuracy of model acquisition and user experience. Attached Figure Description
[0015] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] Figure 1 This is a flowchart illustrating a method for obtaining an image segmentation model according to an embodiment of this application;
[0017] Figure 2 This is a schematic diagram of the structure of an image segmentation model provided in an embodiment of this application;
[0018] Figure 3 This is a flowchart illustrating another method for obtaining an image segmentation model provided in an embodiment of this application;
[0019] Figure 4This is a flowchart illustrating another method for obtaining an image segmentation model provided in an embodiment of this application;
[0020] Figure 5 This is a schematic block diagram of a computer device provided in one embodiment of this application. Detailed Implementation
[0021] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0022] The flowchart shown in the attached diagram is for illustrative purposes only and does not necessarily include all content and operations / steps, nor does it necessarily have to be performed in the order described. For example, some operations / steps can be broken down, combined, or partially merged, so the actual execution order may change depending on the actual situation.
[0023] The term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items, as well as all possible combinations, and includes such combinations.
[0024] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0025] Image segmentation is an important research area in computer vision and a crucial component of image semantic understanding. Image segmentation refers to the process of dividing an image into several regions with similar properties; mathematically, it involves dividing an image into non-overlapping regions. In recent years, with the advancement of deep learning technology, image segmentation has been widely applied in industries such as autonomous driving and security monitoring.
[0026] It should be understood that many image segmentation algorithms for various purposes correspond to different image segmentation needs, resulting in a large number of image segmentation models for users to choose from. It is difficult for users to accurately select the model that best matches the image segmentation task from a large number of image segmentation models, and the accuracy of model selection is difficult to guarantee, which reduces the user experience.
[0027] Please see Figure 1 , Figure 1This is a flowchart illustrating a method for obtaining an image segmentation model according to an embodiment of this application. This method allows for the rational allocation of hardware resources, closely matches the user's image segmentation needs, and effectively improves the accuracy of model acquisition and the user experience.
[0028] like Figure 1 As shown, the method for obtaining the image segmentation model includes steps S101 to S105.
[0029] S101. Obtain the image segmentation requirements and the hardware parameters of the application platform.
[0030] Image segmentation requirements refer to the user's various demands on the image segmentation task, which can be determined based on the actual situation. For example, these can be requirements for image segmentation algorithms, such as threshold segmentation, region segmentation, and edge segmentation; or requirements for the specific techniques used in the segmentation algorithm. For instance, threshold segmentation is further divided into various thresholding techniques, including global thresholding, adaptive thresholding, and optimal thresholding, and the user could request the use of global thresholding. Another example is the requirement for the application field of image segmentation. Image segmentation has a wide range of applications, such as industrial automation, online product inspection, document image processing, and biomedical image analysis, and the user could request that the application field be biomedical images. It should be understood that many image segmentation algorithms for various purposes differ, and usually, image segmentation algorithms need to be adapted by incorporating knowledge of the relevant application field to be suitable for the corresponding application and achieve high-quality, high-standard image segmentation.
[0031] The application platform can be various terminal devices such as computers and mobile phones. These devices include hardware capable of performing mathematical calculations, such as central processing units (CPUs) and graphics processing units (GPUs). Hardware parameters refer to the application platform's ability to perform various types of calculations.
[0032] Specifically, the process involves obtaining the user's image segmentation requirements to ensure that the selected image segmentation model meets these requirements. It also involves obtaining the hardware parameters of the application platform used to perform the image segmentation task to ensure full utilization of hardware resources during model selection. It should be understood that considering only the image segmentation requirements may lead to hardware resource incompatibility, while ignoring the application scenario will result in decreased efficiency and accuracy of the image segmentation model. Therefore, obtaining both the image segmentation requirements and the application platform's hardware parameters allows for the reasonable allocation of hardware resources to meet the user's image segmentation needs.
[0033] In some embodiments, the image segmentation requirements include model operation requirements, which may include timeliness or accuracy requirements, and the hardware parameters may include at least computing power values.
[0034] Among them, model execution requirements are used to characterize the user's requirements for model execution, such as the memory required for model execution, the speed of model execution tasks, and the quality of model execution tasks.
[0035] Model operation requirements include timeliness requirements or accuracy requirements. Timeliness requirements prioritize image segmentation speed in image segmentation tasks, while accuracy requirements prioritize image segmentation quality. In other words, timeliness requirements correspond to speed-priority instructions, and accuracy requirements correspond to accuracy-priority instructions.
[0036] Model operation requirements can be determined based on the application scenario in which the model is used. For example, in medical imaging scenarios, accuracy requirements are extremely high while speed requirements are relatively low, so the model operation requirements include accuracy requirements; as another example, in face detection scenarios, accuracy requirements are not high, but fast recognition is required, so the model operation requirements include timeliness requirements.
[0037] The computing power value is a numerical value used to characterize the computing capabilities of the application platform. It can be calculated based on the hardware parameters of the application platform, and the specific calculation scheme is not limited here. For example, the computing power value can be represented by the application platform's FLOPS (Floating-point Operations Per Second).
[0038] Specifically, it determines whether users prioritize speed or quality in image segmentation tasks, thereby accurately determining the image segmentation model that best suits their needs. The computing power value is used to determine the computational load of the image segmentation model, thus optimizing the effective computing power of the application platform.
[0039] It should be noted that timeliness or accuracy requirements are used to adjust the weight between speed and quality metrics. If the model's operational requirements include timeliness, the weight of the speed metric is higher than that of the quality metric; conversely, if the model's operational requirements include accuracy, the weight of the quality metric is higher than that of the speed metric. The appropriate image segmentation model can be selected based on these weights. It should be understood that the selected target image segmentation model should balance both speed and quality metrics, with the speed or quality metric being more advantageous.
[0040] S102. Determine the computational complexity range of the target image segmentation model based on the image segmentation requirements and the hardware parameters.
[0041] The target image segmentation model is one whose performance meets the image segmentation requirements and whose computational cost matches the computing power of the application platform's hardware parameters. It should be understood that the image segmentation requirements will limit the computational cost of the target image segmentation model. Furthermore, an image segmentation model with a computational cost less than the computing power of the application platform's hardware parameters will perform better on that platform. Therefore, it is necessary to select image segmentation models based on hardware parameters.
[0042] Specifically, the computational complexity range of the suitable image segmentation model is determined based on the user's requirements for the image segmentation task and the hardware parameters of the application platform. For example, if the user specifies the amount of RAM the image segmentation task can occupy, the computational complexity range of the target image segmentation model is determined based on the size of the RAM and the computing power corresponding to the hardware parameters of the application platform. This ensures that the application platform's hardware resources are configured appropriately while meeting the user's image segmentation needs.
[0043] In some embodiments, determining the computational complexity range of the target image segmentation model based on the image segmentation requirements and the hardware parameters includes: when the model operation requirements include the timeliness requirements, obtaining the processing frame rate corresponding to the timeliness requirements; calculating the ratio of the computing power value to the processing frame rate to obtain the first target computational complexity corresponding to the timeliness requirements; and determining the computational complexity range as a first interval consisting of a first threshold and the first target computational complexity.
[0044] The frame rate is the number of frames processed by the model per unit of time.
[0045] The first threshold can be flexibly set according to actual needs. For example, the first threshold can be set to balance speed and quality indicators to avoid ignoring one indicator in order to meet the other. Or, it can be determined according to the model type required by the image segmentation requirements to limit the model type to the corresponding image segmentation model type.
[0046] Specifically, in order to simultaneously meet users' dual needs for ease of use and operational efficiency of the model, when the model's operational requirements include timeliness requirements, the selection of the image segmentation model follows the speed-first instruction, that is, the weight of the speed indicator is higher than the weight of the quality indicator. The processing frame rate corresponding to the timeliness requirement is obtained, the ratio of computing power value to processing frame rate is calculated, and the optimal computing amount that meets the current timeliness requirement is determined, namely the first target computing amount. The first interval formed by the first target computing amount and the first threshold is the computing amount range of the target image segmentation model.
[0047] It should be noted that, with a fixed computing power, the processing frame rate and the computational load of the model are inversely related. A higher processing frame rate results in a lower computational load for the model, and vice versa. The closer the computational load of the image segmentation model is to the initial target computational load, the better it meets the user's timeliness requirements.
[0048] In some embodiments, determining the computational complexity range of the target image segmentation model based on the image segmentation requirements and the hardware parameters includes: when the model operation requirements include the accuracy requirements, using the computing power value as the second target computational complexity; and determining the computational complexity range as a second interval formed by a first threshold and the second target computational complexity.
[0049] The first threshold can be flexibly set according to actual needs. For example, the first threshold can be set to balance speed and quality indicators to avoid ignoring one indicator in order to meet the other. Or, it can be determined according to the model type required by the image segmentation requirements to limit the model type to the corresponding image segmentation model type.
[0050] Specifically, in order to obtain the model accurately on demand while making full use of hardware resources, when the model operation requirements include accuracy requirements, the selection of the image segmentation model follows the quality-first instruction, that is, the weight of the quality index is higher than the weight of the speed index. The computing power of the application platform is used as the second target computational quantity, and the second interval formed by the second target computational quantity and the first threshold is the computational quantity range of the target image segmentation model.
[0051] It should be noted that if the computational value of the target image segmentation model is equal to the computational power of the application platform, it is the highest quality image segmentation model that the current application platform can run. The closer the computational amount of the image segmentation model is to the computational amount of the second target, the better it can meet the user's accuracy requirements.
[0052] In some embodiments, the first threshold is the standard computational cost when the image segmentation model is running normally, and the value of the standard computational cost is less than the computing power value.
[0053] For example, the standard computational cost is the minimum computational cost that can guarantee the normal operation of the image segmentation model. It can be used as a minimum limit for the range of computational costs so that the model obtained by the search is an image segmentation model.
[0054] S103. Search within a preset search space according to the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range.
[0055] Specifically, the preset search space includes a large number of models of various types. A search is performed within this space based on the computational cost range to select multiple candidate image segmentation models that meet the computational cost requirements. It should be understood that these multiple candidate image segmentation models are highly compatible with the hardware resources of the application platform, enabling them to run normally and efficiently within the platform. Furthermore, these models also meet timeliness or accuracy requirements, further matching the user's image segmentation needs. Moreover, searching within the computational cost range effectively reduces model search time and improves model acquisition efficiency.
[0056] In some embodiments, models within a computational range can be searched using AUTOML technology.
[0057] In some embodiments, the step of searching within a preset search space according to the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range includes: when the model operation requirements include the timeliness requirement, searching the preset search space based on a preset search strategy to obtain multiple candidate image segmentation models whose computational complexity is located in the first interval; when the model operation requirements include the accuracy requirement, searching the preset search space based on the preset search strategy to obtain multiple candidate image segmentation models whose computational complexity is located in the second interval.
[0058] The preset search strategy can be flexibly set according to actual needs. Preferably, the preset search strategy can be a random search strategy.
[0059] Specifically, when the model's operational requirements include timeliness, a computational complexity range defined by a first interval is used to search for image segmentation models within the preset search space whose computational complexity falls within the first interval, resulting in multiple candidate image segmentation models. When the model's operational requirements include accuracy, a computational complexity range defined by a second interval is used to search for image segmentation models within the preset search space whose computational complexity falls within the second interval, resulting in multiple candidate image segmentation models. It should be understood that the user's image segmentation needs are further matched according to the different computational complexity ranges corresponding to their image segmentation requirements.
[0060] In some embodiments, the image segmentation model includes an encoder and decoder network with skip connections across stages. The encoder includes multiple first convolutional stages, and the decoder includes multiple second convolutional stages. Each skip connection layer is located between each first convolutional stage and a corresponding second convolutional stage. The step of searching in a preset search space according to the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range further includes: determining the encoder and decoder network corresponding to the computational complexity range, wherein the computational complexity is positively correlated with the number of convolutional stages and the number of skip connection layers in the encoder and decoder network; and searching in the preset search space according to the encoder and decoder network corresponding to the computational complexity range to obtain the multiple candidate image segmentation models.
[0061] Please see Figure 2 , Figure 2 This is a schematic diagram of the structure of an image segmentation model provided in an embodiment of this application. For example... Figure 2 As shown, the image segmentation model can be a deep learning-based image segmentation model, which includes an encoder and decoder network with skip connections across stages. The encoder includes multiple first convolutional stages, and the decoder includes multiple second convolutional stages. Each skip connection layer is located between each first convolutional stage and its corresponding second convolutional stage. Furthermore, the computational cost of this image segmentation model is positively correlated with the number of convolutional stages and skip connection layers in the encoder and decoder networks.
[0062] Specifically, based on the computational requirements corresponding to timeliness or accuracy, and considering the positive correlation between the computational cost of the image segmentation model and the number of convolutional stages and skip connection layers in the encoder and decoder networks, the encoder and decoder network types corresponding to the computational cost range are determined. Based on the encoder and decoder network types, a matching image segmentation model is searched within a preset search space to obtain multiple candidate image segmentation models.
[0063] It should be noted that there are various types of image segmentation models. Based on the correspondence between the structure and computational cost of each type of image segmentation model, a search can be performed within a preset search space to find an accurate target image segmentation model.
[0064] S104. Obtain the evaluation parameters of the multiple candidate image segmentation models.
[0065] For example, the evaluation parameters of a candidate image segmentation model are parameters that measure the performance of the model. Obtaining the evaluation parameters of the model is used to further understand whether the model meets the user's image segmentation needs, and to further select the optimal target image segmentation model from the subsequent models.
[0066] In some embodiments, the evaluation parameters include at least a first evaluation parameter and a second evaluation parameter, wherein the first evaluation parameter is used to evaluate the processing time of the model, and the second evaluation parameter is used to evaluate the accuracy of the model calculation.
[0067] It should be understood that the first evaluation parameter corresponds to the timeliness requirement, and the second evaluation parameter corresponds to the accuracy requirement. The model's matching degree to the user's image segmentation requirements is understood based on the first and second evaluation parameters.
[0068] Please see Figure 3 , Figure 3 This is a flowchart illustrating another method for obtaining an image segmentation model provided in an embodiment of this application. For example... Figure 3 As shown, before obtaining the evaluation parameters of the multiple candidate image segmentation models, the method further includes steps S201 to S203.
[0069] S201. Obtain the training sample set and the test sample set;
[0070] S202. Based on the training sample set, train the multiple candidate image segmentation models to obtain multiple trained candidate image segmentation models;
[0071] S203. Based on the test sample set, test the multiple trained candidate image segmentation models to obtain the first evaluation parameter and the second evaluation parameter of each candidate image segmentation model.
[0072] The training and testing sample sets consist of samples corresponding to multiple image segmentation tasks. The number of samples in each sample set can be flexibly set according to actual needs and is not limited here.
[0073] Specifically, multiple samples are obtained according to the application scenario of the image segmentation task. The samples are divided into training sample set and test sample set by random sampling. Multiple candidate image segmentation models are trained using the training sample set to obtain multiple trained candidate image segmentation models. Then, the multiple trained candidate image segmentation models are tested using the test sample set. The first evaluation parameter and the second evaluation parameter of each candidate image segmentation model are determined based on the test.
[0074] For example, when the application scenario corresponding to the image segmentation task is a medical imaging scenario, multiple samples from multiple medical imaging scenarios are obtained, the average processing time of each trained candidate image segmentation model in the test is calculated to obtain the first evaluation parameter, and the processing result of each trained candidate image segmentation model is analyzed to obtain the second evaluation parameter.
[0075] S105. Based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements, the multiple candidate image segmentation models are screened to determine the target image segmentation model.
[0076] Specifically, based on the evaluation parameters of the candidate image segmentation models, the image segmentation model with the highest matching degree with the image segmentation requirements among multiple candidate image segmentation models is selected and determined as the target image segmentation model, thus further matching the user's image segmentation requirements.
[0077] For example, when the user limits the amount of memory required for the model to run, the evaluation parameters of the candidate image segmentation models can be analyzed based on this, and the image segmentation model with the highest matching degree can be determined as the target image segmentation model.
[0078] In some embodiments, please refer to Figure 4 , Figure 4 This is a flowchart illustrating another method for obtaining an image segmentation model provided in an embodiment of this application. Figure 4 As shown, based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements, the multiple candidate image segmentation models are screened to determine the target image segmentation model, including steps S1051 to S1053.
[0079] S1051. Based on the preset integration rules, calculate the scores corresponding to the first evaluation parameter and the second evaluation parameter of each candidate image segmentation model.
[0080] The preset integration rules can be flexibly set according to different model types.
[0081] Specifically, the evaluation parameters of each candidate image segmentation model are numerically quantified according to a preset integration rule, which facilitates subsequent comprehensive comparison. For example, if model A has a processing time of 25 minutes and a processing accuracy of 70%, then model A's first evaluation parameter is scored as 8 points, and its second evaluation parameter as 7 points. As another example, if model B has a processing time of 40 minutes and a processing accuracy of 90%, then model B's first evaluation parameter is scored as 6 points, and its second evaluation parameter as 9 points. And as yet another example, if model C has a processing time of 15 minutes and a processing accuracy of 50%, then model C's first evaluation parameter is scored as 9 points, and its second evaluation parameter as 5 points.
[0082] S1052. Determine the weight ratio rule according to the image segmentation requirements, and calculate the comprehensive evaluation score of each candidate image segmentation model based on the weight ratio rule and the scores corresponding to the first evaluation parameter and the second evaluation parameter, so as to obtain the comprehensive evaluation score of multiple candidate image segmentation models.
[0083] For example, when the model's operational requirements include timeliness, the weight of the corresponding speed indicator is higher than the weight of the quality indicator; that is, the weight of the first evaluation parameter is higher than the weight of the second evaluation parameter. In this case, the weight ratio of the first evaluation parameter to the second evaluation parameter can be 6:4. Based on the above example, the comprehensive evaluation score of model A is 7.6, the comprehensive evaluation score of model B is 7.2, and the comprehensive evaluation score of model C is 7.4. See Table 1 for details.
[0084] Table 1
[0085] First evaluation parameter 8 6 9 Second evaluation parameter 7 9 5 Overall evaluation score 7.6 7.2 7.4
[0086] For example, when the model's operational requirements include accuracy requirements, the corresponding quality indicator has a higher weight than the speed indicator; that is, the second evaluation parameter has a higher weight than the first evaluation parameter. In this case, the weight ratio of the first evaluation parameter to the second evaluation parameter can be 3:7. Based on the above example, Model A has a comprehensive evaluation score of 7.3, Model B has a comprehensive evaluation score of 8.1, and Model C has a comprehensive evaluation score of 6.2. See Table 2 for details.
[0087] Table 2
[0088]
[0089]
[0090] It should be understood that calculating the comprehensive evaluation score through the weight ratio rule is beneficial for the target image segmentation model to take into account both speed and quality indicators, while meeting users' dual needs for ease of use and operational efficiency.
[0091] S1053. The candidate image segmentation model with the highest comprehensive evaluation score is determined as the target image segmentation model.
[0092] For example, when the model's operational requirements include timeliness requirements, based on the above example, Model A, the candidate image segmentation model with the highest comprehensive evaluation score, is determined as the target image segmentation model.
[0093] For example, when the model's operational requirements include accuracy requirements, based on the above example, model B, being the candidate image segmentation model with the highest comprehensive evaluation score, is determined as the target image segmentation model.
[0094] It should be noted that the above examples using the same model do not mean that multiple candidate image segmentation models obtained when the model operation requirements are different are completely identical. It should be understood that model operation requirements include timeliness requirements or accuracy requirements. When the model operation requirements are different, multiple candidate image segmentation models obtained may have the same parts or may be completely different.
[0095] It should be understood that multiple candidate image segmentation models can already adapt to the hardware resources of the application platform and meet the timeliness or accuracy requirements. At this point, the target image segmentation model is further selected from multiple candidate image segmentation models based on the user's image segmentation requirements. The image segmentation model with the highest matching degree with the user's requirements is determined, which highly matches the user's image segmentation requirements, realizes the reasonable allocation of hardware resources, and effectively improves the accuracy of model acquisition and user experience.
[0096] For example, the above method can be implemented as a computer program, which can be used in, for example... Figure 5 It runs on the computer device shown.
[0097] Please see Figure 5 , Figure 5 This is a schematic diagram of a computer device provided in an embodiment of this application. The computer device can be a terminal device, such as a mobile phone, tablet computer, or wearable device.
[0098] like Figure 5 As shown, the computer device includes a processor, memory, and network interface connected via a system bus, wherein the memory may include volatile storage media, non-volatile storage media, and internal memory.
[0099] Non-volatile storage media can store operating systems and computer programs. These computer programs include program instructions that, when executed, cause the processor to perform any method for acquiring an image segmentation model.
[0100] The processor provides computing and control capabilities, supporting the operation of the entire computer device.
[0101] Internal memory provides an environment for the execution of computer programs stored in non-volatile storage media. When executed by a processor, the computer program enables the processor to perform any method for acquiring an image segmentation model.
[0102] This network interface is used for network communication, such as sending assigned tasks. Those skilled in the art will understand that the structure of this computer device is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0103] It should be understood that the processor can be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among these, a general-purpose processor can be a microprocessor or any conventional processor.
[0104] In some embodiments, the processor is used to run a computer program stored in memory to perform the following steps:
[0105] Obtain the image segmentation requirements and the hardware parameters of the application platform;
[0106] The computational complexity range of the target image segmentation model is determined based on the image segmentation requirements and the hardware parameters.
[0107] Based on the computational complexity range, a search is performed in a preset search space to obtain multiple candidate image segmentation models within the computational complexity range;
[0108] Obtain the evaluation parameters of the multiple candidate image segmentation models;
[0109] Based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements, the multiple candidate image segmentation models are screened to determine the target image segmentation model.
[0110] In some embodiments, the processor is further configured to: when the model running requirements include the timeliness requirement, obtain the processing frame rate corresponding to the timeliness requirement; calculate the ratio of the computing power value to the processing frame rate to obtain the first target computing volume corresponding to the timeliness requirement; and determine the computing volume range as a first interval consisting of a first threshold and the first target computing volume.
[0111] In some embodiments, the processor is further configured to: when the model operation requirements include the accuracy requirements, use the computing power value as a second target computing quantity; and determine the computing quantity range as a second interval consisting of a first threshold and the second target computing quantity.
[0112] In some embodiments, the processor is further configured to: when the model running requirements include the timeliness requirement, search the preset search space based on a preset search strategy to obtain multiple candidate image segmentation models whose computational cost is located in the first interval; when the model running requirements include the accuracy requirement, search the preset search space based on the preset search strategy to obtain multiple candidate image segmentation models whose computational cost is located in the second interval.
[0113] In some embodiments, the image segmentation model includes an encoder and decoder network with skip connections across stages. The encoder includes multiple first convolutional stages, and the decoder includes multiple second convolutional stages. Each skip connection layer is located between each first convolutional stage and a corresponding second convolutional stage. The processor is further configured to: determine the encoder and decoder network corresponding to the computational complexity range, wherein the computational complexity is positively correlated with the number of convolutional stages and the number of skip connection layers in the encoder and decoder network; and search the preset search space according to the encoder and decoder network corresponding to the computational complexity range to obtain the plurality of candidate image segmentation models.
[0114] In some embodiments, the evaluation parameters include at least a first evaluation parameter and a second evaluation parameter, wherein the first evaluation parameter is used to evaluate the processing time of the model, and the second evaluation parameter is used to evaluate the accuracy of the model calculation; the processor is further configured to: acquire a training sample set and a test sample set; train the plurality of candidate image segmentation models based on the training sample set to obtain a plurality of trained candidate image segmentation models; and test the plurality of trained candidate image segmentation models based on the test sample set to obtain a first evaluation parameter and a second evaluation parameter for each candidate image segmentation model.
[0115] In some embodiments, the processor is further configured to: calculate the scores corresponding to the first evaluation parameter and the second evaluation parameter of each candidate image segmentation model based on a preset integral rule; determine the weight ratio rule according to the image segmentation requirements, and calculate the comprehensive evaluation score of each candidate image segmentation model based on the weight ratio rule and the scores corresponding to the first evaluation parameter and the second evaluation parameter, thereby obtaining the comprehensive evaluation score of multiple candidate image segmentation models; and determine the candidate image segmentation model with the highest comprehensive evaluation score as the target image segmentation model.
[0116] This application also provides a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed, implement any of the image segmentation model acquisition methods provided in this application.
[0117] The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiments, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, SmartMedia Card (SMC), Secure Digital (SD) card, or Flash Card equipped on the computer device.
[0118] Furthermore, the computer-readable storage medium may primarily include a program storage area and a data storage area, wherein the program storage area may store the operating system, at least one application required for a function, etc.; and the data storage area may store data created based on the use of blockchain nodes, etc.
[0119] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for obtaining an image segmentation model, characterized in that, The method includes: Obtain the image segmentation requirements and the hardware parameters of the application platform, wherein the hardware parameters include at least the computing power value; The computational complexity range of the target image segmentation model is determined based on the image segmentation requirements and the hardware parameters, wherein the image segmentation requirements are model operation requirements, and the model operation requirements are timeliness requirements or accuracy requirements. Based on the computational complexity range, a search is performed in a preset search space to obtain multiple candidate image segmentation models within the computational complexity range; Obtain the evaluation parameters of the multiple candidate image segmentation models; Based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements, the multiple candidate image segmentation models are screened to determine the target image segmentation model; The step of determining the computational complexity range of the target image segmentation model based on the image segmentation requirements and the hardware parameters includes: When the model operation requirements include the timeliness requirement, the processing frame rate corresponding to the timeliness requirement is obtained, the ratio of the computing power value to the processing frame rate is calculated, the first target computing volume corresponding to the timeliness requirement is obtained, and the range of the computing volume is determined as a first interval consisting of a first threshold and the first target computing volume. When the model operation requirements include the accuracy requirements, the computing power value is used as the second target computing quantity, and the range of the computing quantity is determined as the second interval formed by the first threshold and the second target computing quantity.
2. The method according to claim 1, characterized in that, The first threshold is the standard computational cost when the image segmentation model is running normally, and the value of the standard computational cost is less than the computing power value.
3. The method according to claim 2, characterized in that, The step of searching within a preset search space based on the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range includes: When the model operation requirements include the timeliness requirements, the preset search space is searched based on the preset search strategy to obtain multiple candidate image segmentation models whose computational cost is located in the first interval. When the model operation requirements include the accuracy requirements, the preset search space is searched based on the preset search strategy to obtain multiple candidate image segmentation models whose computational cost is located in the second interval.
4. The method according to claim 3, characterized in that, The image segmentation model includes an encoder and decoder network with cross-stage skip connections. The encoder includes multiple first convolutional stages, and the decoder includes multiple second convolutional stages. Each skip connection layer is located between each first convolutional stage and a corresponding second convolutional stage. The step of searching within a preset search space based on the computational complexity range to obtain multiple candidate image segmentation models within the computational complexity range further includes: Based on the computational complexity range, determine the encoder and decoder networks corresponding to the computational complexity range. The computational complexity is positively correlated with the number of convolutional stages and skip connection layers contained in the encoder and decoder networks. Based on the computational complexity range, the encoder and decoder networks search the preset search space to obtain the multiple candidate image segmentation models.
5. The method according to claim 1, characterized in that, The evaluation parameters include at least a first evaluation parameter and a second evaluation parameter. The first evaluation parameter is used to evaluate the processing time of the model, and the second evaluation parameter is used to evaluate the accuracy of the model calculation. Before obtaining the evaluation parameters of the plurality of candidate image segmentation models, the method further includes: Obtain the training sample set and the test sample set; Based on the training sample set, the multiple candidate image segmentation models are trained to obtain multiple trained candidate image segmentation models. Based on the test sample set, the multiple trained candidate image segmentation models are tested to obtain the first evaluation parameter and the second evaluation parameter of each candidate image segmentation model.
6. The method according to claim 5, characterized in that, The process of filtering the multiple candidate image segmentation models and determining the target image segmentation model based on the evaluation parameters of the multiple candidate image segmentation models and the image segmentation requirements includes: Based on the preset integration rules, the scores corresponding to the first evaluation parameter and the second evaluation parameter of each candidate image segmentation model are calculated. The weight ratio rule is determined according to the image segmentation requirements, and the comprehensive evaluation score of each candidate image segmentation model is calculated based on the weight ratio rule and the scores corresponding to the first evaluation parameter and the second evaluation parameter, so as to obtain the comprehensive evaluation score of multiple candidate image segmentation models. The candidate image segmentation model with the highest comprehensive evaluation score is determined as the target image segmentation model.
7. The method according to claim 1, characterized in that, If the model operation requirements include timeliness requirements, then the weight of speed indicators is higher than that of quality indicators; if the model operation requirements include accuracy requirements, then the weight of quality indicators is higher than that of speed indicators.
8. A computer device, characterized in that, The computer device includes a memory and a processor; The memory is used to store computer programs; The processor is configured to execute the computer program and, in executing the computer program, implement the method for obtaining the image segmentation model as described in any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to implement the method for obtaining the image segmentation model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Neural network structure searching and model publishing method, electronic equipment and storage medium
CN114492742A
Neural network searching method and device, equipment and storage medium
CN115511052A
Data processing method, server and readable medium
WO2020199056A1