Lightweight model automatic optimization method and system based on AI large model

By comparing high-precision and lightweight models to filter difficult samples, and using large AI models to generate images, the lightweight model is automatically trained, which solves the problem of long iteration cycles for human key point detection models on edge devices, and improves recognition accuracy and optimization efficiency.

CN122176751BActive Publication Date: 2026-11-27北京金鼎汉克科技发展有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202610098239.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2026-01-23
Publication Date
2026-11-27
Estimated Expiration
2046-01-23

AI Technical Summary

Technical Problem

When deploying lightweight human key point detection models on edge devices, existing technologies require a lot of manual intervention and have long iteration cycles, which cannot meet the accuracy requirements of complex and ever-changing user scenarios.

Method used

By comparing the results of the high-precision model and the lightweight model, difficult samples are automatically filtered out, and a large number of generated images are generated using the AI ​​large model to form a generated sample set for the automated training and iterative optimization of the lightweight model.

Benefits of technology

It achieves improved recognition accuracy and shortened iteration cycle of lightweight models, without the need for human intervention, thus improving optimization efficiency and saving labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122176751B_ABST
    Figure CN122176751B_ABST
Patent Text Reader

Abstract

The disclosure provides an AI large model-based lightweight model automatic optimization method, in any iteration cycle, comprising: receiving, at a preset period, an original image and a first recognition result output by a first lightweight model deployed on an edge device, obtaining a second recognition result by identifying the original image through a high-precision model; the high-precision model has higher recognition accuracy than the first lightweight model; performing difficult sample detection based on the first recognition result and the second recognition result, determining the original image as a first difficult sample when the detection fails, and determining a first difficult target in the first difficult sample; outputting a first generated image based on the first difficult target through an AI large model; obtaining a third recognition result by identifying the first generated image through the high-precision model; adding the first generated image and the third recognition result to a generated sample set of a current iteration cycle, until the number of generated images in the generated sample set is greater than or equal to a preset number, training a second lightweight model locally based on the generated sample set; performing accuracy evaluation on the trained second lightweight model, and when the evaluation passes, upgrading the first lightweight model based on the trained second lightweight model, and emptying the generated sample set of the current iteration cycle.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of human key point detection, and in particular to a lightweight model automatic optimization method and system based on a large AI model. Background Technology

[0002] When deploying deep learning models for human keypoint detection on edge devices, lightweight models with fewer parameters and lower computational complexity are often used to meet the speed requirements of real-time inference. However, user scenarios are complex and varied, and lightweight models usually cannot meet accuracy requirements. Therefore, it is necessary to collect data from real-world scenarios and optimize the lightweight models to improve accuracy.

[0003] Traditional optimization schemes typically involve first collecting difficult samples and then iterating the lightweight model using these samples. However, collecting difficult samples requires manual intervention, resulting in low efficiency, and a certain amount of data needs to accumulate before a new round of iterations can begin, leading to a long overall iteration cycle.

[0004] There is currently no effective solution to the technical problems of excessive manual intervention and long iteration cycles in the existing technologies mentioned above. Summary of the Invention

[0005] To address the problems existing in the aforementioned related technologies, this disclosure provides a lightweight automatic model optimization method and system based on large AI models.

[0006] The first aspect of this disclosure provides a lightweight automatic model optimization method based on a large AI model, the method being applied to a server, and in any iteration cycle, the method includes: The system receives the original image and its first recognition result from the first lightweight model deployed on the edge device at a preset period, and obtains a second recognition result by recognizing the original image through a high-precision model; the recognition accuracy of the high-precision model is greater than that of the first lightweight model. Based on the first recognition result and the second recognition result, hard sample detection is performed. If the detection fails, the original image is determined to be the first hard sample, and the first hard target in the first hard sample is determined. The first generated image is output based on the first difficult target using a large AI model; The third recognition result is obtained by recognizing the first generated image using the high-precision model. The first generated image and the third recognition result are added to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number. Then, the local second lightweight model is trained based on the generated sample set. The accuracy of the trained second lightweight model is evaluated. If the evaluation is successful, the first lightweight model is upgraded based on the trained second lightweight model, and the sample set generated in the current iteration period is cleared.

[0007] Optionally, the step of performing hard sample detection based on the first recognition result and the second recognition result, determining the original image as a first hard sample when the detection fails, and determining the first hard target in the first hard sample, includes: Based on the first recognition result and the second recognition result, calculate the accuracy gap value corresponding to each recognition target in the original image; If the accuracy gap value corresponding to each recognition target is less than the first threshold, the detection is confirmed to be passed; otherwise, the detection is confirmed to be failed, the original image is determined to be the first difficult sample, and the recognition target with an accuracy gap value greater than or equal to the first threshold is determined to be the first difficult target in the first difficult sample.

[0008] Optionally, the AI ​​large model includes an image understanding large model and an image generation large model. The AI ​​model outputs a first generated image based on the first difficult target, including: Obtain the location of the first difficult target and a screenshot of the first difficult target in the first difficult sample, and update the location information in the prompt words according to the location of the first difficult target; The image understanding big model outputs the pose description information corresponding to the first difficult target based on the updated prompt words and the first difficult sample. The image generation model outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the posture description information.

[0009] Optionally, the image generation large model includes an image-generated large model and a text-generated large model; The image generation model outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the pose description information, including: The image-generated image model outputs a first image based on the environmental description information and a screenshot of the first difficult target; The text-based image model outputs a second image based on the environmental description information and the pose description information; The first image and the second image are used as the first generated image.

[0010] Optionally, training the local second lightweight model based on the generated sample set includes: The generated sample set is divided into a training set, a validation set, and a test set; The second lightweight model is trained using the training set and the validation set.

[0011] Optionally, the accuracy evaluation of the trained second lightweight model includes: The accuracy of the trained second lightweight model is evaluated using the test set to obtain an evaluation value. It is then determined whether the evaluation value is greater than or equal to a second threshold. If yes, the evaluation is considered passed; otherwise, the evaluation is considered failed.

[0012] Optionally, if the evaluation fails, the method further includes: Obtain a second difficult sample and a second difficult target from the test set; The AI ​​model outputs a second generated image based on the second difficult objective, and the second generated image is used as the first generated image in the next iteration cycle.

[0013] Optionally, upgrading the first lightweight model based on the trained second lightweight model includes: The format of the trained second lightweight model is converted to the same format as the first lightweight model, and the first lightweight model is upgraded via OTA.

[0014] A second aspect of this disclosure provides a lightweight model auto-optimization system based on large AI models, the system comprising edge devices and servers, wherein in any iteration cycle: The edge device uploads the first recognition result obtained by recognizing the original image and the first lightweight model in the original image to the server at a preset period. The server uses a high-precision model to identify the original image and obtain a second recognition result; the high-precision model has a higher recognition accuracy than the first lightweight model; based on the first and second recognition results, hard sample detection is performed, and if the detection fails, the original image is determined as a first hard sample, and a first hard target is determined in the first hard sample; a first generated image is output based on the first hard target using an AI large model; a third recognition result is obtained by identifying the first generated image using the high-precision model; the first generated image and the third recognition result are added to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number, and the local second lightweight model is trained based on the generated sample set; the accuracy of the trained second lightweight model is evaluated, and if the evaluation passes, the first lightweight model is upgraded based on the trained second lightweight model, and the generated sample set of the current iteration cycle is cleared.

[0015] A third aspect of this disclosure provides a computer device comprising: The memory and processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the lightweight model automatic optimization method based on the first aspect of the above is implemented.

[0016] A fourth aspect of this disclosure provides a computer-readable storage medium, characterized in that the storage medium stores a computer program that, when executed by a processor, implements the method of the first aspect described above.

[0017] The technical solution provided in this disclosure has the following advantages compared with the prior art: In this embodiment, difficult samples are automatically selected by comparing the results of a high-precision model and a lightweight model. Based on these difficult samples, a large number of generated images are automatically generated using a large AI model. These generated images are then identified by the high-precision model, forming a generated sample set. During an iteration cycle, this generated sample set is automatically used to train and continuously optimize the lightweight model, thereby improving its recognition accuracy. This disclosure automates the entire iteration process by using a generative AI model to automatically generate more difficult samples, eliminating the need for human intervention. This shortens the model iteration cycle and improves the optimization efficiency of the lightweight model.

[0018] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0019] The accompanying drawings, which are incorporated in and form a part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure.

[0020] To more clearly illustrate the technical solutions in the embodiments of this disclosure or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0021] Figure 1 This is a schematic diagram of the structure of a lightweight model automatic optimization system based on a large AI model provided in an embodiment of this disclosure; Figure 2 This is a flowchart of a lightweight automatic model optimization method based on a large AI model provided in this disclosure embodiment; Figure 3 This is a schematic diagram illustrating a target identification method provided in an embodiment of this disclosure; Figure 4 This is a schematic diagram of a first difficult sample provided in an embodiment of this disclosure; Figure 5 This is a flowchart illustrating an image generation method based on a large AI model, as provided in this embodiment. Figure 6 This is an interactive flowchart of a lightweight model automatic optimization method based on a large AI model provided in this embodiment of the disclosure; Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure. Detailed Implementation

[0022] To better understand the above-mentioned objectives, features, and advantages of this disclosure, the solutions disclosed herein will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described herein can be combined with each other.

[0023] Numerous specific details are set forth in the following description in order to provide a full understanding of this disclosure, but this disclosure may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only some, and not all, of the embodiments of this disclosure.

[0024] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0025] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0026] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0027] To address one or more of the aforementioned technical issues, this disclosure proposes a modular code processing method based on dynamic plugin discovery in Agent development. By dynamically loading processing nodes based on functional module metadata during the system initialization phase and verifying the data connection relationships between nodes before execution, the nodes participating in the execution have consistent data interaction constraints. Simultaneously, a hierarchical execution plan is generated based on node dependencies, and nodes are scheduled to execute in parallel within the same level, making module management and execution organization more adaptable to application scenarios with expanded functional module scale and increased task complexity.

[0028] Figure 1 A schematic diagram of the structure of a lightweight model automatic optimization system based on a large AI model provided in an embodiment of this disclosure is shown. Figure 1 As shown, system architecture 10 may include an edge device 101 and a server 102. The edge device 101 can deploy a first lightweight model for human keypoint recognition. The edge device 101 includes an image acquisition device, such as a monocular camera or a binocular camera, for image acquisition. The edge device 101 can be an electronic device with data processing capabilities, used to upload data to the system, configure processing flows, or trigger the execution of code processing tasks. This edge device includes, but is not limited to, smartphones, laptops, desktop computers, motion-sensing game consoles, etc. The edge device 101 and server 102 can communicate via a network. The network can include various connection types, such as wired, wireless communication links, or fiber optic cables. Server 102 is used to execute a lightweight model automatic optimization method based on a large AI model. It can internally deploy a high-precision model for human keypoint recognition, achieving high accuracy, approaching human recognition accuracy as closely as possible. Server 102 also deploys the large AI model and other functional modules. Server 103 can be a single server or a server cluster composed of multiple servers to meet different scenario requirements.

[0029] It should be understood that Figure 1 The number of edge devices and servers shown is merely illustrative. Depending on implementation needs, any number of edge devices and servers can be used.

[0030] like Figure 2 As shown in this embodiment, the lightweight model automatic optimization method based on a large AI model is applied to server 102 in the aforementioned lightweight model automatic optimization system based on a large AI model. In any iteration cycle, the method includes the following steps: Step 210: Receive the original image and its first recognition result output by the first lightweight model deployed on the edge device according to a preset period, and obtain the second recognition result by recognizing the original image through a high-precision model; the recognition accuracy of the high-precision model is greater than that of the first lightweight model.

[0031] In some embodiments, a second lightweight model for human keypoint recognition is deployed on the server. This second lightweight model is the same model as the first lightweight model deployed on the edge device. The second lightweight model requires multiple iterations during training, with the duration of one iteration serving as an iteration cycle. In step 210, the server can receive the original image and its first recognition result output by the first lightweight model deployed on the edge device at a preset cycle. The preset cycle is based on the time period for the edge device to acquire the original images; it can be the time to acquire one original image, or the time to acquire two or more original images. After the image acquisition device deployed on the edge device acquires the original image, it can input it into the first lightweight model to perform human keypoint recognition inference on the original image and output a first recognition result. The first recognition result includes the recognition target (such as a human body image) in the original image and the location of the identified human keypoints. Then, the edge device uploads the original image and the first recognition result to the server via the network. After receiving the original image and the first recognition result, the server can use a locally deployed high-precision model to recognize the original image and obtain a second recognition result; the recognition accuracy of the high-precision model is greater than that of the first lightweight model.

[0032] Step 220: Based on the first recognition result and the second recognition result, perform hard sample detection. If the detection fails, determine the original image as the first hard sample and determine the first hard target in the first hard sample. In some embodiments, the hard sample detection based on the first recognition result and the second recognition result in step 220 can be performed by calculating the accuracy gap value corresponding to each recognition target in the original image based on the first recognition result and the second recognition result.

[0033] like Figure 3 As shown, Figure 3 This is a schematic diagram of a target recognition method provided in an embodiment of this disclosure. The original image 30 includes a human body image, which can be used as the recognition target 301 in the original image 30. If an original image includes multiple human body images, then multiple recognition targets are corresponding to it. Through recognition reasoning using a high-precision model, the positions of key human body points in each recognition target can be obtained. Based on the first recognition result and the second recognition result of each recognition target, the accuracy difference value corresponding to each recognition target in the original image is calculated.

[0034] Optionally, the accuracy gap value can be (1-OKS), where the OKS (Object KeypointSimilarity, the core evaluation metric for human pose estimation) value can be calculated first. The calculation formula is as follows: OKS = Σᵢ[exp(-dᵢ² / 2s²κᵢ²)·δ(vᵢ>0)] / Σᵢ[δ(vᵢ>0)] Where dᵢ is the Euclidean distance between the human keypoints in the first recognition result and the human keypoints in the second recognition result; s is the normalization factor for the human scale (usually the square root of the detection box area); κᵢ is a constant for the i-th keypoint (reflecting the annotation consistency of the keypoint); vᵢ is the visibility flag of the keypoint; δ(condition) is 1 when the condition is true, and 0 otherwise.

[0035] The accuracy difference value of the identified targets is obtained. The larger the accuracy difference value, the greater the difference between the first and second identification results, indicating that the first lightweight model has lower recognition accuracy for the current original image. Conversely, the smaller the difference, the lower the accuracy difference. Optionally, the server can determine whether the accuracy difference value corresponding to each identified target is less than a first threshold. If so, the detection is confirmed to have passed, indicating that the first identification result meets the accuracy requirements; if not, the detection is confirmed to have failed, the first identification result does not meet the accuracy requirements, the original image is determined to be a first difficult sample, and the identified targets with accuracy difference values ​​greater than or less than the first threshold are determined to be the first difficult targets in the first difficult sample. The first difficult target can be the first or more identified targets in the first difficult sample.

[0036] For example, when the first recognition result includes two recognition targets (recognition target A and recognition target B), if the accuracy difference value of recognition target A is less than the first threshold, while the accuracy difference value of recognition target B is greater than the first threshold, then the original image is regarded as the first difficult sample, and recognition target B is regarded as the first difficult target. The first threshold can be set according to actual needs and is not limited here.

[0037] Alternatively, in addition to calculating the precision difference value through OKS, it can also be calculated through PCK (Percentage of Correct Keypoints), EPE (Endpoint Error), and other methods.

[0038] This embodiment can filter difficult samples by comparing the results of high-precision models and lightweight models, thereby achieving the purpose of automatically filtering difficult samples, improving screening efficiency, and reducing manual costs.

[0039] Step 230: Output the first generated image based on the first difficult target using the AI ​​large model.

[0040] In some embodiments, the AI ​​big model in step 230 above may include an image understanding big model and an image generation big model. The step 230 above, in which the AI ​​big model outputs a first generated image based on the first difficult target, specifically includes: Step 501: Obtain the location of the first difficult target and a screenshot of the first difficult target in the first difficult sample, and update the location information in the prompt word according to the location of the first difficult target.

[0041] Among them, there may be multiple first-difficulty targets in the first-difficulty sample, and it is necessary to locate the positions of all first-difficulty targets and obtain screenshots of the first-difficulty targets.

[0042] like Figure 3 As shown, assuming that the identification target 301 included in the first difficult sample 30 is the first difficult target, then the position of the first difficult target is the position of the rectangle formed by coordinates (x1, y1) and (x2, y2). The screenshot of the first difficult target is the screenshot of this rectangle.

[0043] Optionally, the location information in the prompt word can be updated based on the location of the first difficult target.

[0044] For example, the preset prompt is: "Please analyze this image, focusing on the person located in the following coordinate range: [A1, B1, A2, B2]: What is he / she doing, and what are his / her body movements?" Based on the locations of the first difficult objective (x1, y1) and (x2, y2), the updated prompt is: "Please analyze this image, focusing on the person located in the following coordinate range: [x1, y1, x2, y2]: What is he / she doing, and what are his / her body language?" In some embodiments, such as Figure 4 As shown, if the first difficult sample 40 includes two first difficult targets (such as first difficult target 401 and first difficult target 402), then a prompt word can be updated for the position of each first difficult target.

[0045] Step 502: Based on the updated prompts and the first difficult sample, the image understanding big model outputs the pose description information corresponding to the first difficult target.

[0046] Optionally, the image understanding big model can output posture description information corresponding to the first difficult target based on the updated prompt words and the first difficult sample. For example, "He is standing with his arms outstretched, left arm higher than right arm, and legs spread apart."

[0047] Step 503: The large model generates an image and outputs the first generated image based on the preset environmental description information, the screenshot of the first difficult target, and the posture description information.

[0048] In some embodiments, the image generation model in step 503 above may include an image-generated image model and a text-generated image model. The image generation model in step 503 outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the pose description information. Specifically, it may include: the image-generated image model outputting a first image based on the environmental description information and the screenshot of the first difficult target; the text-generated image model outputting a second image based on the environmental description information and the pose description information; and using the first image and the second image as the first generated image.

[0049] Optionally, the preset environmental description information may include descriptions of the background, people, etc. The image-generated image model can generate an image based on the environmental description information and a screenshot of the first difficult target, outputting a first image. The text-generated image model can generate an image based on the environmental description information and the aforementioned posture description information, such as "he is standing, arms outstretched, left arm higher than right arm, legs spread apart," outputting a second image. The number of the first and second images can be set according to the generation conditions, and can be one or more. The set of the first and second images is used as the first generated image.

[0050] This embodiment can use a large image understanding model to describe difficult samples, automatically generate pose description information corresponding to poses that are relatively difficult to identify, and then use both image-generated large image models and text-generated large image models to automatically generate more generated images in a targeted manner, providing more difficult samples for model training iterations, thereby improving the training effect in a targeted manner and shortening the training sample collection cycle.

[0051] Step 240: Obtain a third recognition result by recognizing the first generated image through the high-precision model.

[0052] In some embodiments, the first generated image generated by the large image generation model can be identified by the high-precision model described above to obtain a third identification result.

[0053] Step 250: Add the first generated image and the third recognition result to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number, and then train the local second lightweight model based on the generated sample set.

[0054] In some embodiments, the first generated image and the third recognition result can be added to the generated sample set of the current iteration cycle. Each time a first generated image is added, a judgment process is triggered to determine whether the number of generated images in the current generated sample set is greater than or equal to a preset number (e.g., 500 images). If yes, it means that the number of generated image samples in the current generated image set has reached the training requirement, and the addition of new images can be stopped. If no, it means that the number of generated image samples in the current generated image set has not reached the training requirement, and new images need to be added until the number of generated images in the generated sample set is greater than or equal to the preset number.

[0055] In some embodiments, training the local second lightweight model based on the generated sample set in step 250 may include: dividing the generated sample set into a training set, a validation set, and a test set. The method of division can be determined according to actual needs and is not limited here. After the division is completed, the second lightweight model can be trained using the training set and the validation set. The second lightweight model can be trained multiple times within an iteration cycle. When the preset number of training iterations (e.g., 100 times) is reached or the early termination condition is met (e.g., accuracy no longer improves), the training of the current iteration cycle can be considered complete.

[0056] Step 260: Evaluate the accuracy of the trained second lightweight model. If the evaluation is successful, upgrade the first lightweight model based on the trained second lightweight model and clear the sample set generated in the current iteration cycle.

[0057] In some embodiments, the accuracy evaluation of the trained second lightweight model in step 260 may include: evaluating the accuracy of the trained second lightweight model using the test set, for example, using mAP (mean Average Precision) evaluation, to obtain an evaluation value. The test set includes the third recognition result output by the high-precision model. Then, a fourth recognition result is obtained by the trained second lightweight model recognizing the test set. An evaluation value is calculated based on the third and fourth recognition results of the test set. It is determined whether the evaluation value is greater than or equal to a second threshold. If yes, the accuracy of the trained second lightweight model meets the standard, and the evaluation is considered passed; if no, the accuracy of the trained second lightweight model does not meet the standard, and the evaluation is considered failed. The second threshold can be set according to actual needs and is not limited here.

[0058] In some embodiments, upgrading the first lightweight model based on the trained second lightweight model in step 260 may include: the server converting the format of the trained second lightweight model to the same format as the first lightweight model, or a format supported by the edge device, and performing an OTA (Over-The-Air) upgrade on the first lightweight model. This allows for the upgrade of the first lightweight model on the edge device without physical connection or manual intervention, ensuring that the upgraded first lightweight model has the same recognition accuracy as the trained second lightweight model. This achieves the goal of automatic optimization of the lightweight model on the edge device.

[0059] In some embodiments, when the evaluation fails, the method further includes: obtaining a second difficult sample and a second difficult target from the test set; outputting a second generated image based on the second difficult target using the AI ​​large model; and using the second generated image as the first generated image for the next iteration cycle. Therefore, when the evaluation fails, the accuracy gap value can be calculated based on the third and fourth recognition results of the test set, thereby filtering out the second difficult sample and the second difficult target from the second difficult sample in the test set based on a first threshold. Then, the generated sample set for the current iteration cycle is deleted, and the second difficult sample and the second difficult target from the second difficult sample are input into the aforementioned AI large model to obtain the second generated image as the first generated image for the next iteration cycle, thereby updating the training samples.

[0060] This disclosure allows for the automatic selection of difficult samples by comparing the results of a high-precision model and a lightweight model. Based on these difficult samples, a large AI model automatically generates a large number of generated images. These generated images are then identified by the high-precision model, forming a generated sample set. In one iteration cycle, this generated sample set is automatically used to train and continuously optimize the lightweight model, thereby improving its recognition accuracy. By using a generative AI model to automatically generate more difficult samples for the difficult samples, this disclosure achieves full automation of the entire iteration process without human intervention. Therefore, it achieves comprehensive technical benefits such as shortening the model iteration cycle, improving the optimization efficiency of the lightweight model, and saving labor costs.

[0061] In some embodiments of this disclosure, a lightweight model auto-optimization system based on large AI models can perform... Figure 6 The provided flowchart illustrates an interactive process for a lightweight automatic model optimization method based on large AI models, including the following steps: The execution process in the edge device includes: Step 601: The camera captures the original image; Step 602: The first lightweight model identifies the acquired raw images; Step 603: Asynchronously upload the first recognition result of the first lightweight model and the original image to the server; The execution process in the cloud server includes: Step 604: The high-precision model performs recognition on the original image to obtain a second recognition result; Step 605: Calculate the accuracy difference between the identified target in the first identification result (from the edge device) and the second identification result (from the server); Step 606: Determine whether each precision difference value is less than the first threshold; if the determination result is "yes", proceed to step 607; otherwise, proceed to step 608. Step 607: Discard data (This process ends).

[0062] Step 608: Determine the location of the difficult target in the difficult sample; Step 609: Update the image comprehension prompts for the large model based on the location of the difficult target; Step 610: The large-scale image understanding model outputs pose description information based on the prompt words and difficult samples; Step 611: Based on the image and environmental description information of the difficult target, the large-scale model generates the first image; Step 612: Based on the pose description information and environment description information, the large model generates a second image; Step 613: Merge the first image and the second image to obtain the first generated image; Step 614: The high-precision model annotates the first generated image; Step 615: Update the first generated image after annotation to the generated sample set; Step 616: Determine whether the number of samples in the generated sample set is greater than or equal to the preset number. If the result is "no", return to step 608 and continue collecting difficult samples; if the result is "yes", proceed to step 617. Step 617: Fine-tune the second lightweight model based on the training set and validation set; the generated sample set can be divided into a training set, a validation set, and a test set, and the second lightweight model can be trained and fine-tuned based on the training set and validation set; Step 618: Evaluate the accuracy of the fine-tuned second lightweight model based on the test set; Step 619: Determine whether the evaluation value is ≥ the second threshold; if the determination result is "yes", proceed to step 620; if the determination result is "no", proceed to step 621. Step 620: Model format conversion. Convert the fine-tuned second lightweight model into a format suitable for edge devices, such as the same format as the first lightweight model. After the conversion is complete, push the model to the edge device via OTA upgrade, and the process will terminate.

[0063] Step 621: Calculate the precision gap between the inference results of the new model (the finely tuned second lightweight model) and the test set labels, enter the next iteration cycle, return the precision gap value to step 608 to continue screening difficult samples, and continue iterating and optimizing the process.

[0064] This disclosure uses a generative AI large model to automatically generate more difficult samples for difficult samples, which can realize the full automation of the entire iteration process without human intervention, thus shortening the model iteration cycle and improving the optimization efficiency of lightweight models.

[0065] In some embodiments, based on Figure 1 The schematic diagram of the system shown in this disclosure also provides a lightweight model automatic optimization system 10 based on a large AI model, including an edge device 101 and a server 102, in any iteration cycle: Edge device 101 uploads the acquired raw image and the first lightweight model to the server 102 according to a preset period to obtain a first recognition result. Server 102 uses a high-precision model to identify the original image and obtains a second recognition result; the high-precision model has a higher recognition accuracy than the first lightweight model; based on the first recognition result and the second recognition result, hard sample detection is performed, and if the detection fails, the original image is determined as a first hard sample, and a first hard target is determined in the first hard sample; a first generated image is output based on the first hard target using an AI large model; a third recognition result is obtained by identifying the first generated image using the high-precision model; the first generated image and the third recognition result are added to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number, and the local second lightweight model is trained based on the generated sample set; the accuracy of the trained second lightweight model is evaluated, and if the evaluation passes, the first lightweight model is upgraded based on the trained second lightweight model, and the generated sample set of the current iteration cycle is cleared.

[0066] The lightweight model automatic optimization system based on large AI models provided in this disclosure can implement the methods of any of the above embodiments, and its execution method and beneficial effects are similar, so they will not be described again here.

[0067] This disclosure also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program. When the computer program is executed by the processor, it can implement the methods of any of the above embodiments. The execution method and beneficial effects are similar, and will not be described again here.

[0068] The computer device in this disclosure can be understood as any device with processing and computing capabilities. This device may include, but is not limited to, mobile terminals such as smartphones, laptops, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and wearable devices, as well as fixed electronic devices such as digital TVs, desktop computers, and smart home devices.

[0069] Figure 7 This is a schematic diagram of the structure of a computer device provided in an embodiment of this disclosure, such as... Figure 7 As shown, the computer device 700 may include a processor 710 and a memory 720. The memory 720 stores a computer program 721. When the computer program 721 is executed by the processor 710, it can implement the method provided in any of the above embodiments. The execution method and beneficial effects are similar and will not be described again here.

[0070] Of course, for the sake of simplicity, Figure 7 Only some of the components of the computer device 700 relevant to this disclosure are shown in this illustration, omitting components such as buses, input / output interfaces, input devices, and output devices. In addition, the computer device 700 may include any other suitable components depending on the specific application.

[0071] This disclosure provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it can implement the methods of any of the above embodiments. The execution method and beneficial effects are similar, and will not be described again here.

[0072] The aforementioned computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0073] The computer program described above can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computer device, partially on the user's device, as a standalone software package, partially on the user's computer device and partially on a remote computer device, or entirely on a remote computer device or server.

[0074] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0075] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0076] The above description is merely a specific embodiment of this disclosure, enabling those skilled in the art to understand or implement it. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A lightweight automatic model optimization method based on large AI models, characterized in that, The method is applied to a server, and in any iteration cycle, the method includes: The system receives the original image and its first recognition result from the first lightweight model deployed on the edge device at a preset period, and obtains a second recognition result by recognizing the original image through a high-precision model; the recognition accuracy of the high-precision model is greater than that of the first lightweight model. Based on the first recognition result and the second recognition result, hard sample detection is performed. If the detection fails, the original image is determined to be the first hard sample, and the first hard target in the first hard sample is determined. The first generated image is output based on the first difficult target using a large AI model; The AI ​​big model includes an image understanding big model and an image generation big model. The AI ​​model outputs a first generated image based on the first difficult target, including: Obtain the location of the first difficult target and a screenshot of the first difficult target in the first difficult sample, and update the location information in the prompt words according to the location of the first difficult target; The image understanding big model outputs the pose description information corresponding to the first difficult target based on the updated prompt words and the first difficult sample. The image generation model outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the pose description information; The third recognition result is obtained by recognizing the first generated image using the high-precision model. The first generated image and the third recognition result are added to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number. Then, the local second lightweight model is trained based on the generated sample set. The accuracy of the trained second lightweight model is evaluated. If the evaluation is successful, the first lightweight model is upgraded based on the trained second lightweight model, and the sample set generated in the current iteration period is cleared.

2. The method according to claim 1, characterized in that, The step of performing hard sample detection based on the first recognition result and the second recognition result, determining the original image as a first hard sample when the detection fails, and determining the first hard target in the first hard sample includes: Based on the first recognition result and the second recognition result, calculate the accuracy gap value corresponding to each recognition target in the original image; If the accuracy gap value corresponding to each recognition target is less than the first threshold, the detection is confirmed to be passed; otherwise, the detection is confirmed to be failed, the original image is determined to be the first difficult sample, and the recognition target with an accuracy gap value greater than or equal to the first threshold is determined to be the first difficult target in the first difficult sample.

3. The method according to claim 1, characterized in that, The image generation model includes an image-generated image model and a text-generated image model. The image generation model outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the pose description information, including: The image-generated image model outputs a first image based on the environmental description information and a screenshot of the first difficult target; The text-based image model outputs a second image based on the environmental description information and the pose description information; The first image and the second image are used as the first generated image.

4. The method according to any one of claims 1 to 3, characterized in that, The training of the local second lightweight model based on the generated sample set includes: The generated sample set is divided into a training set, a validation set, and a test set; The second lightweight model is trained using the training set and the validation set.

5. The method according to claim 4, characterized in that, The accuracy evaluation of the trained second lightweight model includes: The accuracy of the trained second lightweight model is evaluated using the test set to obtain an evaluation value. It is then determined whether the evaluation value is greater than or equal to a second threshold. If yes, the evaluation is considered passed; otherwise, the evaluation is considered failed.

6. The method according to claim 5, characterized in that, If the evaluation fails, the method further includes: Obtain a second difficult sample and a second difficult target from the test set; The AI ​​model outputs a second generated image based on the second difficult objective, and the second generated image is used as the first generated image in the next iteration cycle.

7. The method according to claim 1, characterized in that, Upgrading the first lightweight model based on the trained second lightweight model includes: The format of the trained second lightweight model is converted to the same format as the first lightweight model, and the first lightweight model is upgraded via OTA.

8. A lightweight automatic model optimization system based on large AI models, characterized in that, The system includes edge devices and servers, and in any iteration cycle: The edge device uploads the first recognition result obtained by recognizing the original image and the first lightweight model in the original image to the server at a preset period. The server uses a high-precision model to identify the original image and obtain a second identification result. The high-precision model has a higher recognition accuracy than the first lightweight model; based on the first recognition result and the second recognition result, hard sample detection is performed, and if the detection fails, the original image is determined to be the first hard sample, and the first hard target in the first hard sample is determined; the first generated image is output based on the first hard target using the AI ​​large model; The high-precision model identifies the first generated image to obtain a third recognition result; the first generated image and the third recognition result are added to the generated sample set of the current iteration cycle until the number of generated images in the generated sample set is greater than or equal to a preset number; the local second lightweight model is trained based on the generated sample set; the accuracy of the trained second lightweight model is evaluated; if the evaluation passes, the first lightweight model is upgraded based on the trained second lightweight model, and the generated sample set of the current iteration cycle is cleared; The AI ​​big model includes an image understanding big model and an image generation big model. The AI ​​model outputs a first generated image based on the first difficult target, including: Obtain the location of the first difficult target and a screenshot of the first difficult target in the first difficult sample, and update the location information in the prompt words according to the location of the first difficult target; The image understanding big model outputs the pose description information corresponding to the first difficult target based on the updated prompt words and the first difficult sample. The image generation model outputs the first generated image based on preset environmental description information, a screenshot of the first difficult target, and the posture description information.

9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the lightweight model automatic optimization method based on a large AI model as described in any one of claims 1-7.

Citation Information

Patent Citations

  • Method and device for determining training sample and electronic equipment

    CN112183166A

  • Method and system for improving generalization of computer vision small model based on text graph model

    CN120976671A