Model processing method, device, storage medium and electronic device
By a method of obtaining target model packages and verifying them using multiple devices, the problem of low model deployment efficiency in the prior art is solved, and fast and accurate model deployment is achieved, and overall efficiency is improved.
Patent Information
- Application Number
- CN202111402141.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-19
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2041-11-19
AI Technical Summary
In the prior art, the efficiency of deploying models in the platform is low, which makes the model deployment process take a long time and requires a lot of manpower to perform data annotation, model development, model verification and platform deployment.
Responding to the deployment instructions for the target model, obtain the target model package, which includes the target model and the target field. The target model package is verified using multiple devices, and the verification results are used to determine whether the target model package is deployed to the target platform.
The rapid deployment of target models is achieved, the efficiency of model deployment is improved, manual intervention is reduced, and the accuracy of the model after deployment is improved, avoiding the phenomenon of low model accuracy and retraining and deployment.
Smart Images

Figure CN114067182B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of model processing, and in particular to a model processing method, device, storage medium and electronic device. Background Art
[0002] At present, it is necessary to develop corresponding models for different recognition scenarios to adapt to different text formats. If there are many business scenarios, a large amount of manpower is required for data labeling, model development, model verification and platform deployment. The whole process is time-consuming, resulting in low efficiency in model deployment on the platform.
[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0004] The embodiments of the present invention provide a model processing method, device, storage medium and electronic device to at least solve the technical problem of low efficiency in deploying models on a platform in the related art.
[0005] According to one aspect of an embodiment of the present invention, there is provided a method for obtaining a target model package in response to a deployment instruction for a target model, wherein the target model package includes at least a target model and a target field, and the target model is used to recognize text to be recognized corresponding to the target field in a target image; the target model package is verified using multiple devices to obtain a target verification result, wherein the target model is deployed on at least one device among the multiple devices; and based on the target verification result, it is determined whether to deploy the target model package to a target platform.
[0006] Optionally, the target model package is verified using multiple devices to obtain a target verification result, including: using a first device to verify the target model package through a target image set to obtain a first verification result, wherein the target image set includes at least one target image and a labeling result corresponding to the at least one target image; using a second device to verify the target model package through a target image set to obtain a second verification result, wherein a target model is deployed in the second device; and determining the target verification result based on the first verification result and the second verification result.
[0007] Optionally, a first device is used to verify a target model package through a target image set to obtain a first verification result, including: using the first device to use the target model in the target model package to identify the text to be identified corresponding to the target field in at least one target image to obtain a first recognition result; determining a first accuracy of the target model based on the first recognition result and the labeling result; in response to the first accuracy being greater than or equal to a first preset accuracy, determining the first verification result as a verification success; in response to the first accuracy being less than the first preset accuracy, determining the first verification result as a verification failure.
[0008] Optionally, a second device is used to verify the target model package through a target image set to obtain a second verification result, including: using the target model in the second device to recognize the text to be recognized corresponding to the target field in at least one target image to obtain a second recognition result; determining a second accuracy of the target model based on the second recognition result and the labeling result; in response to the second accuracy being greater than or equal to a second preset accuracy, determining that the second verification result is a successful verification; in response to the second accuracy being less than the second preset accuracy, determining that the second verification result is a failed verification.
[0009] Optionally, before using the first device to verify the target model package through the target image set to obtain a first verification result, the method also includes: using the first device to obtain a first storage path and a second storage path, wherein the first storage path is the storage path of the target model package in the target storage module, and the second storage path is the storage path of the target image set in the target storage module; using the first device to obtain the target model package in the target storage module through the first storage path; using the first device to obtain the target image set in the target storage module through the second storage path.
[0010] Optionally, the method also includes: annotating at least one target image using a first preset model to obtain an annotation result corresponding to the at least one target image; generating a target image set based on the at least one target image and the annotation result corresponding to the at least one image; storing the target image set to a target storage module, and generating a second storage path.
[0011] Optionally, after annotating at least one target image using a preset annotation model to obtain an annotation result corresponding to the at least one target image, the method further includes: adjusting the annotation result corresponding to the at least one target image in response to an instruction to adjust the annotation result.
[0012] Optionally, the method also includes: training a second preset model using at least one set of training parameters in a target training set to obtain at least one training model; testing at least one training model to obtain test results, wherein the test results are used to describe the accuracy of each training model; determining a target model from at least one training model based on the test results; storing the target model in a target storage module, and generating a first storage path.
[0013] Optionally, the method further includes: receiving correction parameters through a target interface in response to a correction instruction for the target model; and correcting the target model based on the correction parameters.
[0014] In an embodiment of the present invention, first, in response to a deployment instruction for a target model, a target model package is obtained, wherein the target model package includes at least a target model and a target field, and the target model is used to identify the text to be identified corresponding to the target field in the target image, and then the target model package is verified using multiple devices to obtain a target verification result, wherein the target model is deployed on at least one of the multiple devices, and finally, based on the target verification result, it is determined whether to deploy the target model package to the target platform, thereby achieving the purpose of quickly deploying the target model in the target platform. It is easy to notice that in the process of deploying the target model in the target platform, the target model package can be verified using multiple devices. On the basis of automatic deployment, since the target model package is verified using multiple devices, the accuracy of the model to be deployed can be improved on the basis of quickly deploying the target model, avoiding the need to retrain the model and deploy it due to the low accuracy of the target model, and thus the efficiency of model deployment can be further improved. Thus, the technical problem of low efficiency in deploying models in the platform in the related technology is solved. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0016] Figure 1 is a flow chart of a model processing method according to an embodiment of the present invention;
[0017] Figure 2 is a schematic diagram of a model deployment process according to an embodiment of the present invention;
[0018] Figure 3 is a schematic diagram of a model processing device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0019] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0020] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0021] Example 1
[0022] According to an embodiment of the present invention, a model processing method embodiment is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0023] Figure 1 is a processing method of a model according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0024] Step S102, in response to a deployment instruction for a target model, obtaining a target model package.
[0025] The target model package includes at least a target model and a target field, and the target model is used to identify the text to be identified corresponding to the target field in the target image.
[0026] The above-mentioned target model may be a model to be deployed, wherein the target model may be a new model obtained through training, the target model may also be an optimized model obtained through training of a historical model, or the target model may also be a model obtained through updating of a historical model.
[0027] The above-mentioned target model includes multiple models, for example, a text detection model, an orientation detection model, and a text recognition model. The text in the target image can be detected by the text detection model in the target model. After the text is detected, the orientation of the text in the target image can be detected by the orientation detection model. After the orientation of the text in the target image is obtained, the text in the target image can be recognized by the text recognition model to obtain the text to be recognized corresponding to the target field.
[0028] The above deployment instruction refers to an instruction to deploy the target model to the target platform after obtaining the target model. The target platform may have the target model embedded therein, and the user may use the target model on the target platform to recognize the text to be recognized in the target image.
[0029] The target model package is generated by packaging the target model and the target field, wherein the target model package includes the network service code, so that the target model can be used on the target platform through the network service code.
[0030] The target field is used to determine the text to be recognized by the target model in the target image. The target field may be a key value.
[0031] In an optional embodiment, in response to a deployment instruction for a target model, the automatic packaging platform may package the target model and target fields and generate a target model package. At this time, the target model package may be obtained and the deployment of the target model may be completed through the target model package.
[0032] In another optional embodiment, by acquiring the target field, the target model can recognize the text to be recognized in the target image. For example, the target image can be a text image of a news report, the target field can be a title or an author's name, and the text to be recognized can be the title of the news report and the author of the news report.
[0033] Step S104, using multiple devices to verify the target model package to obtain a target verification result.
[0034] Wherein, the target model is deployed on at least one device among the multiple devices.
[0035] The above-mentioned multiple devices may be multiple physical machines with different deployment environments.
[0036] In an optional embodiment, by verifying the target model package through multiple devices, the recognition capability of the target model in the target model package can be verified in advance before the target model is deployed to the target platform, thereby improving the recognition accuracy of the target model subsequently deployed on the target platform.
[0037] In another optional embodiment, the target model package can be verified by using a device without a target model deployed first, and then the target model package can be verified by using a device with a target model deployed after the verification is successful. If the verification is unsuccessful, the target model can be retrained, and the target model package can be generated based on the retrained target model and target field, and the target model package can be verified again until the verification is successful. After the target model package is successfully verified by using a device without a target model deployed, the target model in the target model package can be deployed in the device, and the target model package can be verified by using a device with a deployed target model. After the verification is successful, the target model package can be deployed in the target platform. If the verification is unsuccessful, the target model is retrained, and the target model package is generated based on the retrained target model and target field, and the target model package is verified again until the verification is successful. Since deploying the target model on the verification device will occupy more memory resources, only when the verification is successful on the device without the target model deployed, the device with the target model deployed is used for verification, which can reduce the occupation of memory resources and improve verification efficiency.
[0038] Step S106, determining whether to deploy the target model package to the target platform based on the target verification result.
[0039] The target platform may be a service platform that provides optical character recognition technology (OCR). The deployed target platform may have a target model embedded in it. The target platform may be an image recognition platform.
[0040] In an optional embodiment, when the verification results of multiple devices in the target verification result are all successful, it is determined that the target model package is deployed to the target platform. If there are devices that have not successfully verified the target model package, the target model will be retrained, and the retrained target model and target field will generate a target model package, and the target model package will be verified again until the verification is successful.
[0041] In another optional embodiment, when the target verification result is that multiple devices are successfully verified, the target platform can be opened and the target model package can be deployed in the target platform.
[0042] In another optional embodiment, the target platform with the target model package deployed can identify and extract the text to be recognized in the target image. For example, in the financial field, it is necessary to perform text recognition on image data of different certificates, bills, etc. The target platform can extract key field information in the image data. Specifically, the positioning model in the target platform can locate the text to be recognized through the target field, and then recognize the text to be recognized through the recognition model to obtain the recognition result, and finally return the recognition result to the client for use.
[0043] Through the above steps, the target model package can be obtained in response to the deployment instruction of the target model, wherein the target model package includes at least the target model and the target field, and the target model is used to identify the text to be identified corresponding to the target field in the target image, and then the target model package is verified by multiple devices to obtain the target verification result, wherein the target model is deployed on at least one of the multiple devices, and finally, based on the target verification result, it is determined whether to deploy the target model package to the target platform, thereby achieving the purpose of quickly deploying the target model in the target platform. It is easy to notice that in the process of deploying the target model in the target platform, the target model package can be verified by multiple devices. On the basis of automatic deployment, since the target model package is verified by multiple devices, the accuracy of the model to be deployed can be improved on the basis of rapid deployment of the target model, and the low accuracy of the target model can be avoided, which requires the model to be retrained and deployed, and the efficiency of model deployment can be further improved. Thus, the technical problem of low efficiency in deploying models in the platform in the related technology is solved.
[0044] Optionally, the target model package is verified using multiple devices to obtain a target verification result, including: using a first device to verify the target model package through a target image set to obtain a first verification result, wherein the target image set includes at least one target image and a labeling result corresponding to the at least one target image; using a second device to verify the target model package through a target image set to obtain a second verification result, wherein a target model is deployed in the second device; and determining the target verification result based on the first verification result and the second verification result.
[0045] The first device mentioned above may be a physical machine, and the second device mentioned above may be a device that deploys the target model in the target model package through a Docker container (an open source application container engine). The Docker container can be automatically started on the GPU (Graphics Processing Unit) of the physical machine through Docker-compose (a tool for running an open source application container engine), and the target model can be deployed on the physical machine through the Docker container.
[0046] The target image set may be a set of images including multiple target images and multiple annotation results corresponding to the multiple target images. The target image set may be stored in a preset storage device. The target image set in the storage device may be continuously updated.
[0047] In an optional embodiment, the most recently updated target image set can be obtained from the storage device, and the target model package can be verified by the first device through the target image set. Specifically, the target model and target field in the target model package can be used to identify the text to be identified in the target image in the target image set to obtain a recognition result, and the recognition accuracy of the target model can be determined by comparing the recognition result with the annotation result in the target image set. When the recognition accuracy is greater than the preset recognition accuracy, the first verification result of the first device is determined to be a successful verification.
[0048] Furthermore, after the first device successfully verifies, the acquired target model package and target image set can be sent to the second device, and the target model package can be verified in the second device through the target image set to obtain the recognition accuracy of the target model. When the recognition accuracy is greater than the preset recognition accuracy, the second device is determined to have successfully verified. Optionally, it is also possible to determine whether the recognition accuracy of the first device and the recognition accuracy of the second device are consistent on the basis that the recognition accuracy is greater than the preset recognition accuracy. If they are consistent, the second device is determined to have successfully verified; if they are inconsistent, the target model can be retrained, and a target model package can be generated based on the retrained target model and target field, and the target model package can be verified again until the recognition accuracy of the two devices is the same, and then the second verification result of the second device is determined to be a successful verification.
[0049] Optionally, a first device is used to verify a target model package through a target image set to obtain a first verification result, including: using the first device to use the target model in the target model package to identify the text to be identified corresponding to the target field in at least one target image to obtain a first recognition result; determining a first accuracy of the target model based on the first recognition result and the labeling result; in response to the first accuracy being greater than or equal to a first preset accuracy, determining the first verification result as a verification success; in response to the first accuracy being less than the first preset accuracy, determining the first verification result as a verification failure.
[0050] The first preset accuracy mentioned above can be determined by the user.
[0051] In an optional embodiment, the target model and the target field can be used in the first device to identify the text to be identified corresponding to at least one target image in the target image set to obtain the identified text, that is, the first recognition result mentioned above, and the identified text is compared with the annotation result corresponding to the target image, and the first accuracy of the target model is determined based on the comparison result. If the number of similarities between the two is greater, the recognition accuracy of the target model is higher, that is, the first accuracy of the target model recognition is higher.
[0052] In another optional embodiment, when the first accuracy is greater than or equal to the first preset accuracy, it can be explained that the number of the recognized texts and the annotation results corresponding to the target image is the same or the similarity is high. In this case, it is explained that the recognition ability of the target model is strong, and the first verification result can be determined to be a successful verification. When the first accuracy is less than the first preset accuracy, it can be explained that the number of the recognized texts and the annotation results corresponding to the target image is the same or the similarity is low. In this case, it is explained that the recognition ability of the target model is strong and cannot meet the recognition requirements, and the first verification result can be determined to be a failed verification.
[0053] Optionally, a second device is used to verify the target model package through a target image set to obtain a second verification result, including: using the target model in the second device to recognize the text to be recognized corresponding to the target field in at least one target image to obtain a second recognition result; determining a second accuracy of the target model based on the second recognition result and the labeling result; in response to the second accuracy being greater than or equal to a second preset accuracy, determining that the second verification result is a successful verification; in response to the second accuracy being less than the second preset accuracy, determining that the second verification result is a failed verification.
[0054] In an optional embodiment, the target model and the target field can be used in the second device to identify the text to be identified corresponding to at least one target image in the target image set to obtain the identified text, that is, the second recognition result mentioned above, and the identified text is compared with the annotation result corresponding to the target image, and the second accuracy of the target model is determined based on the comparison result. If the number of similarities between the two is greater, the recognition accuracy of the target model is higher, that is, the second accuracy of the target model recognition is higher.
[0055] In another optional embodiment, when the second accuracy is greater than or equal to the second preset accuracy, it can be explained that the number of the recognized texts and the annotation results corresponding to the target image is the same or the similarity is high. In this case, it is explained that the recognition ability of the target model is strong, and the second verification result can be determined to be a successful verification. When the second accuracy is less than the second preset accuracy, it can be explained that the number of the recognized texts and the annotation results corresponding to the target image is the same or the similarity is low. In this case, it is explained that the recognition ability of the target model is strong and cannot meet the recognition requirements, and the second verification result can be determined to be a failed verification.
[0056] Optionally, before using the first device to verify the target model package through the target image set to obtain a first verification result, the method also includes: using the first device to obtain a first storage path and a second storage path, wherein the first storage path is the storage path of the target model package in the target storage module, and the second storage path is the storage path of the target image set in the target storage module; using the first device to obtain the target model package in the target storage module through the first storage path; using the first device to obtain the target image set in the target storage module through the second storage path.
[0057] In an optional embodiment, in order to save space in the first device, the packaged target model package and the labeled target image set can be stored in the target storage module so that they can be obtained from the target storage module when needed, saving device space used for verification.
[0058] The target storage module mentioned above may be a system storage medium, such as a hodoop (an open source framework for processing, storing and analyzing massive amounts of distributed, unstructured data) storage cluster.
[0059] In an optional embodiment, after the automatic packaging platform has packaged the target model package according to the target model and the target field, the target model package may be first stored in the target storage module, and a first storage path of the target model package in the target storage module may be generated; after the labeling platform labels the target image, obtains the labeling result, and generates a target image set based on the target image and its corresponding target result, the target image set may be stored in the target storage module, and a second storage path of the target image set in the target storage module may be generated.
[0060] In another optional embodiment, when the first device receives a deployment instruction for a target model, it can obtain a first storage path and a second storage path, and obtain a pre-stored target model package in the target storage module through the first storage path, and obtain a pre-stored target image set in the target storage module using the second storage path.
[0061] Optionally, the method also includes: annotating at least one target image using a first preset model to obtain an annotation result corresponding to the at least one target image; generating a target image set based on the at least one target image and the annotation result corresponding to the at least one image; storing the target image set to a target storage module, and generating a second storage path.
[0062] The first preset model may be a pre-trained annotation model, through which the target image can be annotated and the annotation result corresponding to the target image can be obtained. The first preset model may be a position pre-annotation model, a transcription pre-annotation model, etc. The at least one target image may be image data related to the business.
[0063] In an optional embodiment, the annotation task sent by the user can be accepted first, and the relevant target image to be annotated can be obtained according to the annotation task, and the target image can be annotated in the annotation platform to obtain the annotation result, and the target image set can be generated based on the target image and the annotation result. The annotation platform can provide the functions of position annotation and text transcription, and the target image can be annotated in the annotation platform through the embedded position and transcription pre-annotation model to obtain the annotation result corresponding to the target image, and the target image set can be generated based on the target image and the annotation result corresponding to the target image.
[0064] Furthermore, after the target image set is generated, the target image set may be stored in a target storage module, and when the target model needs to be verified, the target image set may be obtained according to the generated second storage path.
[0065] Optionally, after annotating at least one target image using a preset annotation model to obtain an annotation result corresponding to the at least one target image, the method further includes: adjusting the annotation result corresponding to the at least one target image in response to an instruction to adjust the annotation result.
[0066] In an optional embodiment, after obtaining the annotation results corresponding to at least one target image, in order to further improve the accuracy of the annotation, the target image and the corresponding annotation results can be sent to the client, and the client can adjust the incorrectly annotated results to improve the accuracy of the annotation results.
[0067] Furthermore, after adjusting the annotation results, a target image set can be generated based on the target image and the corresponding adjusted annotation results. The adjusted annotation results can also be used to train the first preset model to improve the accuracy of the first preset model.
[0068] Optionally, the method also includes: training a second preset model using at least one set of training parameters in a target training set to obtain at least one training model; testing at least one training model to obtain test results, wherein the test results are used to describe the accuracy of each training model; determining a target model from at least one training model based on the test results; storing the target model in a target storage module, and generating a first storage path.
[0069] The target training set mentioned above may include multiple groups of training parameters, wherein the training parameters of different groups may be different. The second preset model mentioned above may be a model to be trained.
[0070] In an optional embodiment, the second preset model can be trained in the training platform using multiple groups of training parameters in the target training set to obtain multiple groups of training models. By testing the accuracy of the multiple groups of training models, test results of the multiple groups of training models can be obtained, and based on the test results, the target model with the highest accuracy can be determined from the multiple training models, and the target model can be stored in the target storage module for subsequent use in the deployment process.
[0071] In another optional embodiment, a training environment can be provided in a training platform to train multiple groups of different parameters for general orientation detection, text positioning, and character recognition models, respectively. The training parameters can provide default configurations based on experience to facilitate adaptation to different needs. For customized needs, the training parameters can be uploaded by the user, and a group of models with the highest accuracy in each type of model can be obtained as the target model, and the model configuration corresponding to the target model can be obtained, and the model configuration can be stored in the code parameters. When the target model is subsequently obtained, the configuration corresponding to the target model can be obtained from the code repository.
[0072] Optionally, the method further includes: receiving correction parameters through a target interface in response to a correction instruction for the target model; and correcting the target model based on the correction parameters.
[0073] In an optional embodiment, after the target model package is deployed on the target platform, an application interface can be provided for external access. For the correction of the target model in the target platform, the correction parameters can be received through the above-mentioned target interface, and the target model can be corrected using the correction parameters to improve the accuracy of the target model.
[0074] Furthermore, when providing recognition services, the target platform can automatically mark unrecognized data and use the unrecognized data for subsequent troubleshooting and model optimization. Specifically, the unrecognized data can be sent to the client, and the user can annotate the unrecognized data, and use the image corresponding to the unrecognized data and the corresponding annotation results to optimize the target model in the target platform.
[0075] Combine the following Figure 2 A preferred embodiment of the present invention is described in detail.
[0076] like Figure 2 The figure shows a schematic diagram of the model deployment process, which includes a labeling platform, a training platform, a system storage medium, a code repository, an automatic packaging service, an automatic deployment verification service, a physical machine proxy service, an open source application container engine, and an image recognition platform. The labeling platform can label the training data and store the labeled data obtained after labeling in the system storage medium. The training platform can train the model through multiple sets of training data, and determine the optimal model from the trained multiple models, and store the optimal model in the system storage medium. At the same time, the model parameters of the optimal model can be stored in the code repository. The automatic packaging service can obtain the key value of the key field, select the template code from the code repository, obtain the model path from the system storage medium, call the target field from the key field through the template code, and package the target field and the target model to generate a target model package, and send the model path corresponding to the target model package to the automatic deployment verification service.
[0077] Furthermore, in the automatic deployment verification service, the model package path and the annotated data path can be sent to the physical machine proxy service. The physical machine proxy service can obtain the model package and the annotated data according to the model package path and the annotated data path, and use the annotated data to verify the model package through the physical machine. After successful verification, the Docker container deployment model service can be automatically started on the physical machine GPU through docker-compose, and verified on the physical machine where the target model is deployed. If the verification is successful, the target model package can be deployed to the target platform. Subsequently, an AIP interface can be provided to the target platform, and the unrecognizable data can be saved to the system storage medium using the AIP interface for subsequent optimization of the model.
[0078] The accuracy verification of the target model mainly includes three parts. The first is that the training platform uses different model parameters for each type of model to train multiple models at the same time, uses labeled data to test the model accuracy, and selects a model with a higher accuracy than the preset accuracy. The second is to verify the accuracy of each key field in the environment through the annotation results of the target image before going online. Only when the accuracy reaches the preset accuracy can the target model package be deployed in the target platform. If it is lower than the preset accuracy, the model is retrained. The third is the last verification before going online to ensure that the service accuracy of the online environment is consistent with the accuracy of the test environment before opening the target platform and deploying the target model in the target platform.
[0079] In an embodiment of the present invention, iterative services of models can be automatically released. By embedding a pre-annotated model in the annotation platform, the efficiency of manual annotation of business data can be accelerated; the annotated data is sent to the training platform to simultaneously train multiple sets of parameters for the general model; the optimal model is stored in the system storage medium; the automatic deployment online platform pulls the template code and the optimal model and automatically packages them in the docker container for automatic deployment and evaluation, and the deployment of the target platform can be completed when the accuracy rate is qualified; the target platform can mark badcase (unrecognized data), and the badcase can be sent to the annotation platform to iterate and update the target platform. The present invention can efficiently and quickly update the target model in the target platform, wherein the target platform can extract the structured fields of various certificates and bill pictures through the target model. In addition to the annotation and key field configuration, the overall process does not require manual development and deployment, and realizes low-cost and efficient release iteration for the image recognition platform.
[0080] Example 2
[0081] According to an embodiment of the present invention, a model processing device is also provided, which can execute the model processing method in the above embodiment. The specific implementation method and preferred application scenario are the same as the above embodiment and will not be repeated here.
[0082] Figure 3 is a schematic diagram of a processing device of a model according to an embodiment of the present invention, such as Figure 3 As shown, the apparatus includes: an acquisition module 302, for acquiring a target model package in response to a deployment instruction for a target model, wherein the target model package includes at least a target model and a target field, and the target model is used to identify the text to be identified corresponding to the target field in the target image; a verification module 304, for verifying the target model package using multiple devices to obtain a target verification result, wherein the target model is deployed on at least one of the multiple devices; a deployment module 306, for determining whether to deploy the target model package to the target platform based on the target verification result.
[0083] Optionally, the verification module includes: a first verification unit, used to verify the target model package through a target image set using a first device to obtain a first verification result, wherein the target image set includes at least one target image and a labeling result corresponding to the at least one target image; a second verification unit, used to verify the target model package through a target image set using a second device to obtain a second verification result, wherein a target model is deployed in the second device; a determination unit, used to determine the target verification result based on the first verification result and the second verification result.
[0084] Optionally, the first verification unit includes: a first identification subunit, used to identify the text to be identified corresponding to the target field in the at least one target image by using the target model in the target model package through the first device to obtain a first recognition result; a first determination subunit, used to determine a first accuracy of the target model based on the first recognition result and the labeling result; the first determination subunit is also used to determine that the first verification result is a successful verification in response to the first accuracy being greater than or equal to a first preset accuracy; the first determination subunit is also used to determine that the first verification result is a failed verification in response to the first accuracy being less than the first preset accuracy.
[0085] Optionally, the second verification unit includes: a second identification subunit, used to identify the text to be identified corresponding to the target field in the at least one target image by using the target model in the second device to obtain a second identification result; a second determination subunit, used to determine a second accuracy of the target model based on the second recognition result and the labeling result; the second determination subunit is also used to determine that the second verification result is a successful verification in response to the second accuracy being greater than or equal to a second preset accuracy; the second determination subunit is also used to determine that the second verification result is a failed verification in response to the second accuracy being less than the second preset accuracy.
[0086] Optionally, the acquisition module is also used to use the first device to acquire a first storage path and a second storage path, wherein the first storage path is the storage path of the target model package in the target storage module, and the second storage path is the storage path of the target image set in the target storage module; the acquisition module is also used to use the first device to acquire the target model package in the target storage module through the first storage path; the acquisition module is also used to use the first device to acquire the target image set in the target storage module through the second storage path.
[0087] Optionally, the device further includes: a labeling module, a generating module, and a first storage module.
[0088] Among them, the labeling module is used to use the first preset model to label at least one target image to obtain a labeling result corresponding to the at least one target image; the generation module is used to generate a target image set based on the at least one target image and the labeling result corresponding to the at least one image; the first storage module is used to store the target image set to the target storage module and generate a second storage path.
[0089] Optionally, the device further includes: an adjustment module, configured to adjust the annotation result corresponding to at least one target image in response to an instruction to adjust the annotation result.
[0090] Optionally, the device also includes: a training module, used to train a second preset model using at least one set of training parameters in a target training set to obtain at least one training model; a testing module, used to test at least one training model to obtain a test result, wherein the test result is used to describe the accuracy of each training model; a determination module, used to determine a target model from at least one training model based on the test result; and a second storage module, used to store the target model to a target storage module and generate a first storage path.
[0091] Optionally, the device further comprises: a receiving module, configured to receive correction parameters through a target interface in response to a correction instruction for the target model; and a correction module, configured to correct the target model based on the correction parameters.
[0092] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0093] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0094] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0095] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0096] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0097] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0098] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing a model, characterized in that: include: In response to a deployment instruction for a target model, a target model package is acquired, wherein the target model package includes at least the target model and a target field, and the target model is used to recognize a text to be recognized corresponding to the target field in a target image; Verifying the target model package using multiple devices to obtain a target verification result, wherein the target model is deployed on at least one device among the multiple devices; Determine whether to deploy the target model package to the target platform based on the target verification result.
2. The method according to claim 1, characterized in that The target model package is verified using multiple devices to obtain target verification results, including: Using a first device to verify the target model package through a target image set to obtain a first verification result, wherein the target image set includes at least one target image and a labeling result corresponding to the at least one target image; Using a second device to verify the target model package through the target image set to obtain a second verification result, wherein the target model is deployed in the second device; The target verification result is determined based on the first verification result and the second verification result.
3. The method according to claim 2, characterized in that Using a first device to verify the target model package through a target image set to obtain a first verification result, including: Recognize the text to be recognized corresponding to the target field in the at least one target image by using the target model in the target model package by the first device to obtain a first recognition result; Determining a first accuracy of the target model based on the first recognition result and the labeling result; In response to the first accuracy being greater than or equal to a first preset accuracy, determining the first verification result as a successful verification; In response to the first accuracy being less than the first preset accuracy, the first verification result is determined to be a verification failure.
4. The method according to claim 2, characterized in that: Verifying the target model package using the target image set using a second device to obtain a second verification result includes: Obtaining a second recognition result by using the target model in the second device to recognize the text to be recognized corresponding to the target field in the at least one target image; Determining a second accuracy of the target model based on the second recognition result and the labeling result; In response to the second accuracy being greater than or equal to a second preset accuracy, determining the second verification result as verification success; In response to the second accuracy being less than the second preset accuracy, the second verification result is determined to be a verification failure.
5. The method according to claim 4, characterized in that Before verifying the target model package using the first device through the target image set to obtain a first verification result, the method further includes: Using the first device to obtain a first storage path and a second storage path, wherein the first storage path is a storage path of the target model package in the target storage module, and the second storage path is a storage path of the target image set in the target storage module; Obtaining the target model package in the target storage module by using the first device through the first storage path; The target image set is acquired in the target storage module by using the first device through the second storage path.
6. The method according to claim 5, characterized in that The method further comprises: Annotating the at least one target image using a first preset model to obtain an annotation result corresponding to the at least one target image; generating the target image set based on the at least one target image and the annotation result corresponding to the at least one target image; The target image set is stored in the target storage module, and the second storage path is generated.
7. The method according to claim 6, characterized in that After annotating the at least one target image using a preset annotation model to obtain an annotation result corresponding to the at least one target image, the method further includes: In response to the instruction to adjust the annotation result, the annotation result corresponding to the at least one target image is adjusted.
8. The method according to claim 7, characterized in that The method further comprises: Training the second preset model using at least one set of training parameters in the target training set to obtain at least one training model; Testing the at least one training model to obtain a test result, wherein the test result is used to describe the accuracy of each training model; determining the target model from the at least one training model based on the test result; The target model is stored in the target storage module, and the first storage path is generated.
9. The method according to claim 1, characterized in that: The method further comprises: In response to a modification instruction for the target model, receiving a modification parameter via a target interface; The target model is modified based on the modification parameters.
10. A model processing device, characterized in that: include: An acquisition module, configured to acquire a target model package in response to a deployment instruction for a target model, wherein the target model package at least includes the target model and a target field, and the target model is used to recognize a text to be recognized corresponding to the target field in a target image; A verification module, used to verify the target model package using multiple devices to obtain a target verification result, wherein the target model is deployed on at least one device among the multiple devices; A deployment module is used to determine whether to deploy the target model package to a target platform based on the target verification result.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the model processing method described in any one of claims 1 to 9.
12. An electronic device, characterized in that: include: A processor and a memory, wherein the processor is used to run a program stored in the memory, wherein the program executes the model processing method described in any one of claims 1 to 9 when running.
Citation Information
Patent Citations
Model deployment method, apparatus and device, and storage medium
CN111861020A
Application online method, system and device based on deep learning, and medium
CN112527321A