Optimization method of image synthesis algorithm and image synthesis method and device
Through the dual guarantee of offline quality inspection model and abnormal interception model, the image synthesis algorithm is optimized and abnormal images are intercepted, which solves the problem of low image quality generated by the image synthesis algorithm and significantly improves the user experience and yield rate.
Patent Information
- Application Number
- CN202410841123.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-26
- Publication Date
- 2024-10-01
AI Technical Summary
The images generated by existing image synthesis algorithms are of low quality, resulting in poor user experience and low yield, which affects the application experience.
A pre-trained offline quality inspection model is used to perform refined anomaly detection on face images in synthetic images, the image synthesis algorithm is optimized, and a lightweight anomaly interception model is combined with online interception of abnormal images to improve the quality and yield of image generation.
By optimizing the image synthesis algorithm in advance and intercepting abnormal images online, the user experience of image synthesis applications and the yield rate of synthesized images are significantly improved, ensuring that the generated images are of higher quality.
Smart Images

Figure CN118736046A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of the present specification relate to the field of computer network technology, and in particular, to an optimization method for an image synthesis algorithm, an image synthesis method and an image synthesis device. Background Art
[0002] With the development of artificial intelligence generation content (AIGC) technology, there are more and more application scenarios for generating images based on AIGC technology. For example, in an image synthesis application, the user can first upload the user image, and then select the template image to be synthesized. After that, the image synthesis algorithm can generate an image based on the user image uploaded by the user and the template image selected by the user. Among them, the quality of the image generated by the image synthesis algorithm is an important factor affecting the user experience. If the yield rate of the image generated by the image synthesis algorithm is low, the probability of displaying abnormal images to the user is high, which will seriously affect the user's experience of the image synthesis application.
[0003] Therefore, it is necessary to provide a method that can improve the yield rate of images synthesized by an image synthesis algorithm. Summary of the invention
[0004] In order to improve the yield rate of images synthesized by an image synthesis algorithm and to enhance the user experience of image synthesis applications, one or more embodiments of this specification provide an image synthesis algorithm optimization method, an image synthesis method and an apparatus.
[0005] In a first aspect, one or more embodiments of the present specification provide a method for optimizing an image synthesis algorithm, the method comprising: obtaining a synthetic image to be inspected, wherein the synthetic image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm; performing anomaly detection on a target facial image in the synthetic image to be inspected using an offline quality inspection model to obtain a first detection result; the target facial image is any facial image in the synthetic image to be inspected; and optimizing the image synthesis algorithm based on the first detection result.
[0006] In one possible implementation, the method further includes: performing anomaly detection on the target face image using an anomaly interception model to obtain a second detection result; if the first detection result is inconsistent with the second detection result, sending a first prompt message, wherein the first prompt message is used to prompt manual anomaly detection on the target person image; receiving manually input manual detection results; and optimizing the image synthesis algorithm based on the manual detection results.
[0007] In a possible implementation manner, the method further includes: if the first detection result is consistent with the second detection result, optimizing the image synthesis algorithm based on the first detection result and / or the second detection result.
[0008] In one possible implementation, the first detection result is the abnormality type corresponding to the target facial image, and the second detection result is the normal score corresponding to the target facial image; wherein, when the normal score is greater than the normal threshold, the second detection result is that the target facial image is normal; when the normal score is less than or equal to the normal threshold, the second detection result is that the target facial image is abnormal.
[0009] In one possible implementation, after receiving the manual detection results manually input, the method also includes: sending a second prompt message to the model with abnormality detection error, the second prompt message is used to prompt the abnormality detection error of the target face image; the model with abnormality detection error is the offline quality inspection model or the abnormality interception model.
[0010] In one possible implementation, the method further includes: extracting at least one target face attribute information based on the target face image; obtaining template attribute information of a face at the same position in the template image as the target face image; determining whether each target face attribute information is consistent with the corresponding template attribute information; if the target face attribute information is inconsistent with the template attribute information, correcting the attribute information in the template attribute information that is inconsistent with the target face attribute information.
[0011] In a possible implementation, the method further includes: based on the template image, performing anomaly detection on the non-face image in the synthesized image to be inspected to obtain a non-face image detection result; and optimizing the image synthesis algorithm based on the non-face image detection result.
[0012] In one possible implementation, based on the template image, performing abnormality detection on the non-face image in the synthetic image to be inspected to obtain a non-face image detection result, including: based on the template image, performing abnormality detection on the clarity and / or content of the non-face image in the synthetic image to be inspected to obtain a clarity detection result and / or a content abnormality detection result.
[0013] In a possible implementation, the offline quality inspection model is a pre-trained visual-language pre-trained model, and the detection accuracy of the offline quality inspection model is higher than the detection accuracy of the abnormal interception model.
[0014] In a second aspect, one or more embodiments of the present specification provide an image generation method, the method comprising: receiving a user image uploaded by a user; determining a template image selected by the user; and generating a composite image based on the user image and the template image using an image synthesis algorithm optimized by any method described in the first aspect.
[0015] In a possible implementation, after generating a composite image based on the user image and the template image using an image synthesis algorithm optimized by the method as described in any one of the first aspects, the method further includes: performing anomaly detection on a target facial image in the composite image using an anomaly interception model; the target facial image is any facial image in the composite image; if the target facial image is abnormal, generating a third prompt information, the third prompt information being used to indicate that the composite image is abnormal; if the target facial image is normal, displaying the composite image.
[0016] In one possible implementation, the use of an anomaly interception model to perform anomaly detection on the target facial image in the composite image includes: using the anomaly interception model to determine a normal score of the target facial image; if the normal score is greater than a normal threshold, determining that the target facial image in the composite image is normal; if the normal score is less than or equal to the normal threshold, determining that the target facial image in the composite image is abnormal.
[0017] In a possible implementation, before generating a composite image based on the user image and the template image using an image synthesis algorithm optimized by the method as described in any one of the first aspects, the method further includes: performing abnormality detection on the user image; if the user image is normal, generating a composite image based on the user image and the template image using the image synthesis algorithm optimized by the method as described in any one of the first aspects; if there is an abnormality in the user image, generating a fourth prompt information, wherein the fourth prompt information is used to indicate that the user image is abnormal.
[0018] In a third aspect, one or more embodiments of the present specification provide a method for training an offline quality inspection model, wherein the offline quality inspection model is a visual-language pre-training model, and the method comprises: obtaining training data; wherein the training data comprises sample images and real abnormality types corresponding to the sample images, and the sample images comprise normal images and abnormal images; obtaining abnormality detection instructions; taking the sample images and the abnormality detection instructions as inputs of the offline quality inspection model, and outputting abnormality description information; determining the predicted abnormality type corresponding to the sample image based on the abnormality description information; and training the offline quality inspection model until convergence based on the real abnormality type and the predicted abnormality type to obtain a trained offline quality inspection model.
[0019] In a possible implementation, the anomaly detection instruction includes an anomaly detection instruction corresponding to at least one language.
[0020] In a fourth aspect, one or more embodiments of the present specification provide an optimization device for an image synthesis algorithm, the device comprising: a first acquisition module, used to acquire a synthetic image to be inspected, wherein the synthetic image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm; a first detection module, used to perform anomaly detection on a target face image in the synthetic image to be inspected using an offline quality inspection model to obtain a first detection result; the target face image is any face image in the synthetic image to be inspected; and an optimization module, used to optimize the image synthesis algorithm based on the first detection result.
[0021] In one possible implementation, the device also includes: a second detection module, used to use an abnormality interception model to perform abnormality detection on the target face image to obtain a second detection result; a first sending module, used to send a first prompt message if the first detection result is inconsistent with the second detection result, and the first prompt message is used to prompt manual abnormality detection on the target person image; a first receiving module, used to receive manually input manual detection results; the optimization module is also used to optimize the image synthesis algorithm based on the manual detection results.
[0022] In one possible implementation, the first detection result is the abnormality type corresponding to the target facial image, and the second detection result is the normal score corresponding to the target facial image; wherein, when the normal score is greater than the normal threshold, the second detection result is that the target facial image is normal; when the normal score is less than or equal to the normal threshold, the second detection result is that the target facial image is abnormal.
[0023] In a possible implementation, the optimization module is further configured to optimize the image synthesis algorithm based on the first detection result and / or the second detection result if the first detection result is consistent with the second detection result.
[0024] In one possible implementation, the device also includes: a second sending module, used to send a second prompt message to the model with an abnormality detection error, the second prompt message is used to prompt an abnormality detection error for the target face image; the model with an abnormality detection error is the offline quality inspection model or the abnormality interception model.
[0025] In one possible implementation, the device also includes: an extraction module, used to extract at least one target face attribute information based on the target face image; a fourth acquisition module, used to obtain the template attribute information of the face at the same position as the target face image in the template image; a third determination of whether each target face attribute information is consistent with the corresponding template attribute information; and a correction module, used to correct the attribute information in the template attribute information that is inconsistent with the target face attribute information if the target face attribute information is inconsistent with the template attribute information.
[0026] In one possible implementation, the device also includes: a fourth detection module, used to perform anomaly detection on the non-face image in the synthetic image to be inspected based on the template image, and obtain a non-face image detection result; an optimization module, also used to optimize the image synthesis algorithm based on the non-face image detection result.
[0027] In one possible implementation, the fourth detection module is used to perform anomaly detection on the non-face image in the synthetic image to be inspected based on the template image, and obtain a non-face image detection result; specifically: the fourth detection module is used to perform anomaly detection on the clarity and / or content of the non-face image in the synthetic image to be inspected based on the template image, and obtain a clarity detection result and / or a content anomaly detection result.
[0028] In a possible implementation, the offline quality inspection model is a pre-trained visual-language pre-trained model, and the detection accuracy of the offline quality inspection model is higher than the detection accuracy of the abnormal interception model.
[0029] In a fifth aspect, one or more embodiments of the present specification provide an image generating device, comprising: a second receiving module for receiving a user image uploaded by a user; a first determining module for determining a template image selected by a user; and a generating module for generating a synthesized image based on the user image and the template image using an image synthesis algorithm optimized by the method described in any one of the first aspects.
[0030] In one possible implementation, the device also includes: a third detection module, used to use an abnormality interception model to perform abnormality detection on the target facial image in the composite image; the target facial image is any one or more facial images in the composite image; a generation module, used to generate third prompt information if the target facial image is abnormal, and the third prompt information is used to indicate that the composite image is abnormal; and a display module, used to display the composite image if the target facial image is normal.
[0031] In a possible implementation, the third detection module is used to perform anomaly detection on the target face image in the composite image by using an anomaly interception model; specifically:
[0032] The third detection module is used to use the abnormal interception model to determine the normal score of each target face image; if the normal score is greater than the normal threshold, it is determined that the target face image in the composite image is normal; if the normal score is less than or equal to the normal threshold, it is determined that the target face image in the composite image is abnormal.
[0033] In one possible implementation, the device also includes a fifth detection module, which is used to perform abnormality detection on the user image; if the user image is normal, a composite image is generated based on the user image and the template image using an image synthesis algorithm optimized by the method described in any one of the first aspects; if there is an abnormality in the user image, a fourth prompt information is generated, and the fourth prompt information is used to indicate that the user image is abnormal.
[0034] In a sixth aspect, one or more embodiments of the present specification provide a training device for an offline quality inspection model, wherein the offline quality inspection model is a visual-language pre-training model, and the device comprises: a second acquisition module, used to acquire training data; wherein the training data comprises a sample image and a real abnormality type corresponding to the sample image, and the sample image comprises a normal image and an abnormal image; a third acquisition module, used to acquire an abnormality detection instruction; an output module, used to output abnormality description information using the sample image and the abnormality detection instruction as input of the offline quality inspection model; a second determination module, used to determine the predicted abnormality type corresponding to the sample image based on the abnormality description information; a training module, used to train the offline quality inspection model until convergence based on the real abnormality type and the predicted abnormality type, to obtain a trained offline quality inspection model.
[0035] In a possible implementation, the anomaly detection instruction includes an anomaly detection instruction corresponding to at least one language.
[0036] In the seventh aspect, one or more embodiments of the present specification also provide an electronic device, comprising a memory and a processor; the memory is used to store a computer program product; the processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method of the first aspect, the second aspect or the third aspect mentioned above is implemented.
[0037] In an eighth aspect, one or more embodiments of the present specification further provide a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed, the method of the first aspect, the second aspect, or the third aspect described above is implemented.
[0038] In summary, in order to improve the yield rate of images synthesized by an image synthesis algorithm, one or more embodiments of this specification provide an optimization method, an image synthesis method, and a device for an image synthesis algorithm. Among them, the optimization method of the image synthesis algorithm can use a pre-trained offline quality inspection model to perform refined anomaly detection on face images in a batch of synthesized images to dig out anomalies in the synthesized images as much as possible. In this way, the image synthesis algorithm can be optimized based on the anomalies dug out, so that the optimized image synthesis algorithm can avoid the occurrence of anomalies as early as possible.
[0039] In the subsequent image generation stage, the optimized image synthesis algorithm can be used to generate a synthetic image based on the user image and the template image. In this way, since the optimized image synthesis algorithm has already optimized the possible abnormal situations in advance, the yield rate of the synthetic image can be improved. In addition, in the image generation stage, the pre-trained lightweight abnormal interception model can be used to intercept the abnormal synthetic image to compensate for the situation where the optimized image synthesis algorithm still generates abnormal images. In this way, by optimizing the image synthesis algorithm in advance and intercepting the abnormal synthetic image online, the dual guarantee of these two can greatly improve the user experience of the image synthesis application. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the technical solutions of one or more embodiments of the present specification, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of one or more embodiments of the present specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0041] Figure 1 A flowchart of a method for training an offline quality inspection model provided in one or more embodiments of this specification;
[0042] Figure 2 A flowchart of a method for training an abnormal interception model provided in one or more embodiments of this specification;
[0043] Figure 3 A flowchart of an optimization method for an image synthesis algorithm provided in one or more embodiments of this specification;
[0044] Figure 4A flowchart of another method for optimizing an image synthesis algorithm provided for one or more embodiments of this specification;
[0045] Figure 5 A flowchart of an image generation method provided for one or more embodiments of this specification;
[0046] Figure 6 A structural block diagram of an optimization device for an image synthesis algorithm provided in one or more embodiments of this specification;
[0047] Figure 7 A structural block diagram of an image generating device provided for one or more embodiments of this specification;
[0048] Figure 8 A structural block diagram of a training device for an offline quality inspection model provided in one or more embodiments of this specification;
[0049] Fig. 9 A structural block diagram of an electronic device provided for one or more embodiments of this specification. DETAILED DESCRIPTION
[0050] The following further describes one or more embodiments of the present specification in detail through the accompanying drawings and examples. Through these descriptions, the features and advantages of one or more embodiments of the present specification will become clearer and more specific.
[0051] The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise noted.
[0052] In addition, the technical features involved in different implementations of one or more embodiments of this specification described below can be combined with each other as long as they do not conflict with each other.
[0053] To facilitate understanding, the application scenarios of the technical solutions provided by one or more embodiments of this specification are first described below.
[0054] With the development of artificial intelligence generation content (AIGC) technology, there are more and more application scenarios for generating images based on AIGC technology.
[0055] For example, when using an image synthesis application or function in an electronic device such as a mobile phone, the user can first upload a user image and then select a template image to be synthesized. Afterwards, the image synthesis algorithm can generate an image based on the user image uploaded by the user and the template image selected by the user. The generated image is an image obtained by fusing the user image with the template image. Finally, the generated image is displayed on the display interface of the electronic device.
[0056] Among them, the quality of images generated by the image synthesis algorithm is an important factor affecting the user experience. If the yield rate of the images generated by the image synthesis algorithm is low, the probability of abnormal images displayed to the user is high, which will seriously affect the user's experience of the image synthesis application.
[0057] In order to improve the yield rate of images synthesized by an image synthesis algorithm, one or more embodiments of this specification provide an optimization method, an image synthesis method, and a device for an image synthesis algorithm. Among them, the optimization method of the image synthesis algorithm can use a pre-trained offline quality inspection model to perform refined anomaly detection on face images in a batch of synthesized images to dig out anomalies in the synthesized images as much as possible. In this way, the image synthesis algorithm can be optimized based on the anomalies dug out, so that the optimized image synthesis algorithm can avoid the occurrence of anomalies as early as possible.
[0058] In the subsequent image generation stage, the optimized image synthesis algorithm can be used to generate a synthetic image based on the user image and the template image. In this way, since the optimized image synthesis algorithm has already optimized the possible abnormal situations in advance, the yield rate of the synthetic image can be improved. In addition, in the image generation stage, the pre-trained lightweight abnormal interception model can be used to intercept the abnormal synthetic image to compensate for the situation where the optimized image synthesis algorithm still generates abnormal images. In this way, by optimizing the image synthesis algorithm in advance and intercepting the abnormal synthetic image online, the dual guarantee of these two can greatly improve the user experience of the image synthesis application.
[0059] The following first describes the offline quality inspection model, anomaly interception model, and image synthesis algorithm involved in one or more embodiments of this specification.
[0060] Both the offline quality inspection model and the anomaly interception model are models obtained through training and can detect anomalies in facial images in synthetic images.
[0061] Among them, since the offline quality inspection model is mainly used in the offline quality inspection stage, and the role of the offline quality inspection model is mainly to dig out various abnormalities in the synthetic image as much as possible. Based on this, the offline quality inspection model can use a large model that can dig out the abnormalities of the synthetic image in a more detailed manner. For example, the offline quality inspection model can use a visual-language pre-trained model such as LLaVA1.5-13b.
[0062] Among them, the LLaVA1.5-13b large-scale vision-language pre-trained model series, which performs self-supervised pre-training on massive image-text data pairs, has acquired powerful visual understanding and multimodal perception capabilities. LLaVA 1.5-13b can process image and text inputs simultaneously, generate relevant text descriptions, answer questions, etc.
[0063] Since the anomaly interception model is mainly used in the online interception stage, there are certain requirements for the interception speed of the anomaly interception model. In other words, in the online interception stage, it is more desirable to use an efficient anomaly interception model to intercept abnormal situations. Based on this, the anomaly interception model can use a model that is lighter and has a slightly lower detection accuracy than the offline quality inspection model. For example, the anomaly interception model can use a lightweight model with ShuffleNetV2 as the backbone network.
[0064] The image synthesis algorithm is an algorithm that can generate a synthetic image based on the user image and the template image. The image synthesis algorithm can replace the face in the template image with the face in the user image, so that the face in the user image and the template image are merged to obtain a synthetic image that conforms to the style of the template.
[0065] It should be noted that one or more embodiments of this specification do not limit user images and template images. Among them, user images may include single-person images, double-person images, or multi-person images. Correspondingly, template images may include template images suitable for single-person images, double-person images, or multi-person images. Template images may include template images of various styles and scenes.
[0066] The following describes an embodiment of a method for training an offline quality inspection model and an abnormality interception model provided in one or more embodiments of this specification.
[0067] The training method of the offline quality inspection model and the training method of the abnormal interception model provided in the embodiments of the present application can be implemented by deploying a neural network model and a computer program code in software form in a hardware computing environment. The available hardware computing environment can be, for example: a personal computer, a server, a handheld device or a portable device, a tablet device, a multi-processor system, a microprocessor-based system, a programmable consumer electronic device, a cloud server, a server instance, a supercomputer, etc.
[0068] See also Figure 1 , Figure 1 A flowchart of a method for training an offline quality inspection model provided in one or more embodiments of this specification. Figure 1 As shown, the method may include the following steps:
[0069] Step S102, obtaining training data.
[0070] The training data may include sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images.
[0071] It should be noted that the sample image in step S102 refers to a composite image obtained based on the user image and the template image.
[0072] In one practicable manner, a user image may be fused with multiple template images to obtain multiple sample images. Alternatively, a single user image may be fused with faces of multiple people in a template image to obtain multiple sample images.
[0073] In this way, the scene of image synthesis can be simulated by the above method to generate a large number of sample images, wherein the sample images may include normal images and abnormal images.
[0074] Optionally, the number of normal images and the number of abnormal images in the sample images are similar in proportion, for example, the number of normal images accounts for 49% and the number of abnormal images accounts for 51%.
[0075] One or more embodiments of this specification do not limit the abnormality type. For example, the abnormality type can be divided into the following four abnormality types: abnormality of distorted forehead and messy hair, abnormality of distorted or incomplete ears, abnormality of facial features collapse and deformity, and abnormality of no abnormality. Among them, the abnormality type corresponding to the normal image is abnormality of no abnormality.
[0076] In this way, when the number of sample images is limited, by classifying the anomaly types into the above four types, the problem of long-tail distribution and imbalance of anomaly types can be avoided.
[0077] Step S104, obtaining an abnormality detection instruction.
[0078] Step S106, using the sample image and the anomaly detection instruction as input of the offline quality inspection model, and outputting anomaly description information.
[0079] Taking the offline quality inspection model using a visual-language pre-trained model such as LLaVA1.5-13b as an example, a sample image and anomaly detection instructions can be input into the offline quality inspection model. In this way, the offline quality inspection model can output corresponding anomaly description information based on the input sample image and anomaly detection instructions.
[0080] Optionally, the anomaly detection instruction may be a text description or a voice description.
[0081] For example, the anomaly detection instruction may be a text description such as "Does the person in the picture have obvious abnormalities? Which body part is obviously deformed?". Correspondingly, the anomaly description information may be a text description such as "In this picture, the abnormality of the person is her eyes. Her eyes appear very large and can even be described as "huge black eyes". This feature makes her appearance very unique and eye-catching."
[0082] In this way, by using LLaVA1.5-13b as a content understanding model and combining it with the design of anomaly detection instructions, the offline quality inspection model has a certain continuity. For example, different anomaly detection instructions can be designed according to different tasks. For example, anomaly detection instructions can include aesthetics, consistency and other related anomaly detection instructions.
[0083] One or more embodiments of this specification may also use anomaly detection instructions in different languages. For example, anomaly detection instructions in different languages (such as Chinese, English, Russian, etc.) may be set for the same sample image. Using this training method, there is a 1-2% gain in LLaVA1.5-13b's understanding of the sample image content.
[0084] It should be noted that in one or more embodiments of the present specification, the anomaly detection instruction may be configured in the training data. For example, the training data includes a sample image and a real anomaly type corresponding to the sample image and an anomaly detection instruction.
[0085] Step S108: determining the predicted abnormality type corresponding to the sample image based on the abnormality description information.
[0086] After obtaining the exception description information, the corresponding predicted exception type can be determined based on the exception description information.
[0087] For example, if the abnormal description information is "In this picture, the abnormality of the character is her eyes. Her eyes appear very large and can even be described as "huge black eyes". This feature makes her appearance very unique and eye-catching." In this way, it can be determined that the predicted abnormality type corresponding to the abnormal description information is the facial features collapse and deformity abnormality.
[0088] As another example, if the abnormal description information is "In this figure, there is no obvious deformity in the body parts of the character. However, his facial features and body proportions may not meet the standards of ordinary people because he is portrayed as a cartoon character. Cartoon characters usually exaggerate or simplify the characteristics of the characters to better conform to the artist's design and the audience's expectations." In this way, it can be determined that the predicted abnormality type corresponding to the abnormal description information is no abnormality found.
[0089] Step S110: Based on the real abnormality type and the predicted abnormality type, the offline quality inspection model is trained until convergence to obtain a trained offline quality inspection model.
[0090] The training process of the offline quality inspection model is an iterative process. Through multiple iterations, the network parameters inside the offline quality inspection model are continuously optimized and updated to make the network loss continue to converge. When the network loss is less than the loss threshold, the training ends and a trained offline quality inspection model is obtained.
[0091] In one possible implementation, the offline quality inspection model can be trained by fine-tuning LLaVA1.5-13b based on QLora technology. Among them, QLora technology is a technical method for quickly fine-tuning large pre-trained language models. Its core idea is to introduce only a small number of trainable parameters (such as low-rank matrices, attention layers, etc.) on the basis of the original large model, without updating the massive parameters of the entire large model. By training these newly added small parameters, the original large model can adapt to and learn new downstream tasks, and realize rapid fine-tuning and transfer learning of the model.
[0092] In a possible implementation, the offline quality inspection model is trained to convergence, which can be implemented in the following manner: first, the network loss is calculated based on the real abnormality type and the predicted abnormality type. Then, it is determined whether the network loss is less than the loss threshold. If the network loss is less than the loss threshold, the training is terminated. If the network loss is greater than or equal to the loss threshold, the above steps S106 to S110 are repeated until the network loss is less than the loss threshold.
[0093] When the network loss is less than the loss threshold, it indicates that the offline quality inspection model has been trained to convergence. In this case, the training of the offline quality inspection model can be terminated to obtain the trained offline quality inspection model.
[0094] When the network loss is greater than or equal to the loss threshold, it indicates that the offline quality inspection model has not been trained to convergence. In this case, the network parameters of the offline quality inspection model can be optimized through back propagation until the offline quality inspection model is trained to convergence, thereby obtaining a trained offline quality inspection model.
[0095] It should be noted that the embodiment of the present application only takes the training of the offline quality inspection model based on network loss as an example for illustrative purposes, and does not limit the offline quality inspection model training method. For example, when the number of training times for the offline quality inspection model reaches a preset number, the training can be terminated to obtain a trained offline quality inspection model.
[0096] The offline quality inspection model training method provided in one or more embodiments of the present specification can use a visual-language pre-trained model such as LLaVA1.5-13b as an offline quality inspection model; then, the offline quality inspection model is trained with a large number of sample images so that the trained offline quality inspection model can perform refined identification of abnormal types of synthetic images.
[0097] See also Figure 2 , Figure 2 A flowchart of a training method for an abnormal interception model provided in one or more embodiments of this specification. Figure 2 As shown, the method may include the following steps:
[0098] Step S202, obtaining training data.
[0099] Step S202 is similar to the training data in step S102, except that the real labels corresponding to the sample images in the training data in step S202 are not abnormal types, but labels representing abnormality and normality. For example, the training data in step S202 includes real labels 0 and 1 corresponding to the sample images, where real label 0 represents abnormality and real label 1 represents normality.
[0100] In one possible implementation, there is a certain amount of subjective ambiguity or misjudgment between labels (i.e., there are non-1 and non-0 situations). Therefore, the training data can be mixed (mixup) data enhancement processing to improve the model's perception of the data. Among them, the mixed (mixup) data enhancement processing can be understood as: performing linear interpolation processing on the training data to generate new sample images and labels, thereby increasing the diversity of the training data. In this way, it helps the model to recognize the true situation of data distribution, enhance the model's perception of sample boundaries, and will not overconfidently classify samples into a fixed label.
[0101] Step S204, using the sample images in the training data as input of the abnormal interception model, and outputting a normal score.
[0102] Step S206: Determine the predicted label corresponding to the sample image based on the normal score and the normal threshold.
[0103] Step S208: Based on the predicted labels and the true labels, the anomaly interception model is trained until convergence to obtain a trained anomaly interception model.
[0104] In a possible implementation, the anomaly interception model can use ShuffleNetV2 as the backbone network. Since ShuffleNetV2 is a lightweight neural network, in the subsequent online stage, the lightweight anomaly interception model can be used to identify anomalies in synthetic images, which can meet the needs of rapid identification of facial anomalies.
[0105] After the sample image is input into the anomaly interception model, the anomaly interception model can identify the anomaly of the sample image and then output the corresponding normal score. The normal score can be used to characterize the probability that the input sample image tends to be normal. The higher the normal score, the greater the probability that the input sample image tends to be normal. For example, the probability that the normal score of 0.7 corresponds to a higher normality than the normal score of 0.5.
[0106] In a possible implementation, the prediction label corresponding to the sample image is determined based on the normal score and the normal threshold, which can be implemented in the following manner: if the normal score is greater than the normal threshold, the prediction label corresponding to the sample image can be determined as normal, for example, the prediction label is 1. If the normal score is less than or equal to the normal threshold, the prediction label corresponding to the sample image can be determined as abnormal, for example, the prediction label is 0.
[0107] The normal threshold value can be defined according to the actual application scenario, and one or more embodiments of this specification do not limit this. For example, the normal threshold value can be set to 0.5.
[0108] Furthermore, the network loss can be calculated based on the predicted label and then the real label. If the network loss is less than the loss threshold of the anomaly interception model, the training is terminated. If the network loss is greater than or equal to the loss threshold of the anomaly interception model, the above steps S204 to S208 are repeated until the network loss is less than the loss threshold of the anomaly interception model, the training is terminated, and the trained anomaly interception model is obtained.
[0109] It should be noted that the embodiments of the present application are only illustrative of the training of the anomaly interception model based on network loss, and do not limit the training method of the anomaly interception model. For example, when the number of training times of the anomaly interception model reaches a preset number, the training can be terminated to obtain a trained anomaly interception model.
[0110] The training method of the abnormal interception model provided in one or more embodiments of this specification can use a lightweight neural network such as ShuffleNetV2 as the backbone network of the abnormal interception model, and model the abnormal image problem as a binary classification, that is, judging whether the input image is a normal image. Then, the abnormal interception model is trained with a large number of sample images, so that the trained abnormal interception model can quickly identify whether the synthetic image is normal or abnormal.
[0111] After the offline quality inspection model and the anomaly interception model are obtained through training, the image synthesis algorithm may be optimized based on the trained offline quality inspection model and / or the anomaly interception model.
[0112] The following describes an embodiment of an optimization method for an image synthesis algorithm provided by one or more embodiments of this specification.
[0113] See also Figure 3 , Figure 3 The flowchart of an optimization method of an image synthesis algorithm provided in one or more embodiments of this specification is shown. The method can be applied to a server or a terminal device. Figure 3 As shown, the method may include the following steps:
[0114] Step S302: obtaining a composite image to be inspected.
[0115] The composite image to be inspected is an image synthesized based on the user image and the template image using an image synthesis algorithm.
[0116] Optionally, the synthetic image to be inspected may be an image generated by simulating an image synthesis scene. In this way, a large number of abnormal images and normal images may be simulated and generated, thereby providing a large amount of relevant data for the optimization of the image synthesis algorithm.
[0117] Optionally, the composite image to be inspected may also be a real historical composite image. For example, the composite image (i.e., the historical composite image) generated when each user uses the image synthesis application or function may be stored in the cloud or server. Then, the historical composite image may be obtained from the cloud or server at regular intervals and used as the composite image to be inspected. In this way, the inspection of the historical composite image may be implemented to further discover abnormal problems that may not have been discovered before.
[0118] Step S304: Use the offline quality inspection model to perform abnormality detection on the target face image in the synthetic image to be inspected, and obtain a first detection result.
[0119] Among them, the composite image to be inspected may include one or more facial images. In this way, for a composite image to be inspected that includes a facial image, an abnormality detection may be performed on a facial image in the composite image to be inspected. For a composite image to be inspected that includes multiple facial images, an abnormality detection may be performed on at least one facial image in the composite image to be inspected. For example, for a composite image to be inspected that includes multiple facial images, an abnormality detection may be performed on all or part of the facial images in the composite image to be inspected. The following is an example of performing an abnormality detection on a target facial image in a composite image to be inspected, wherein the target facial image may be any facial image in the composite image to be inspected.
[0120] One or more embodiments of the present specification can use the offline quality inspection model trained by the above embodiments to perform abnormality detection on the target face image in the quality inspection composite image to obtain a first detection result. The first detection result can be an abnormality type corresponding to the target face image, for example, the first detection result can be a forehead distortion, messy hair abnormality, a distorted or incomplete ear abnormality, a facial feature collapse and deformity abnormality, or no abnormality is found.
[0121] Step S306: optimizing the image synthesis algorithm based on the first detection result.
[0122] Exemplarily, when the first detection result is that the target facial image is abnormal, for example, the first detection result is that the forehead is distorted and the hair is messy, the ears are distorted or incomplete, or the facial features are collapsed and deformed, the image synthesis algorithm can be optimized based on the first detection result so that the optimized image synthesis algorithm can reduce the probability of the abnormal situation occurring as much as possible.
[0123] In this way, the optimization method of the image synthesis algorithm provided in one or more embodiments of the present specification can use the pre-trained offline quality inspection model to perform abnormality detection on any face image in the quality inspection composite image, so as to find abnormal problems in the quality inspection composite image as much as possible. In this way, the discovered abnormal problems can be fed back to the image synthesis algorithm, so that the image synthesis algorithm is optimized based on the abnormality detection results, so that the optimized image synthesis algorithm can reduce the probability of the abnormal situation as much as possible.
[0124] See also Figure 4 , Figure 4 A flowchart of another method for optimizing an image synthesis algorithm provided in one or more embodiments of this specification. Figure 4 As shown, the optimization method of the image synthesis algorithm provided in one or more embodiments of this specification can also be implemented in the following manner:
[0125] Step S402: obtaining a composite image to be inspected.
[0126] Step S404: Use the offline quality inspection model to perform anomaly detection on the target face image in the synthetic image to be inspected, and obtain a first detection result.
[0127] Step S406: Use the anomaly interception model to perform anomaly detection on the target face image to obtain a second detection result.
[0128] Step S408, determining whether the first detection result is consistent with the second detection result.
[0129] One or more embodiments of this specification can use the abnormal interception model trained by the above embodiments to perform abnormal detection on the target face image in the synthetic image to be inspected to obtain a second detection result. Exemplarily, the second detection result can be a normal score corresponding to the target face image.
[0130] In one possible implementation, determining whether the first test result is consistent with the second test result can be implemented in the following manner: determining whether the first test result is consistent with the second test result based on the anomaly type detected by the offline quality inspection model and the normal score detected by the anomaly interception model.
[0131] Exemplarily, if the first test result is an abnormal type such as a distorted forehead with messy hair, distorted or incomplete ears, or a collapsed and deformed facial feature, the second test result is a normal score that is less than or equal to the normal threshold, such as a normal score of 0.3. In this case, it can be judged that the first test result is consistent with the second test result. If the first test result is that no abnormality is found, and the second test result is a normal score that is greater than the normal threshold, such as a normal score of 0.7. In this case, it can also be judged that the first test result is consistent with the second test result. Correspondingly, in all cases except the above two cases, it can be judged that the first test result is inconsistent with the second test result.
[0132] In this way, the anomaly detection results of the target face image can be cross-validated through the offline quality inspection model and the anomaly interception model, which can improve the reliability of the anomaly detection results and avoid the impact of misjudgment caused by a single model.
[0133] Step S410: If the first detection result is inconsistent with the second detection result, a first prompt message is sent, wherein the first prompt message is used to prompt a human to perform anomaly detection on the target face image.
[0134] Step S412, receiving manually input manual detection results.
[0135] When the first detection result is inconsistent with the second detection result, anomaly detection can be performed by manual intervention. Specifically, when the first detection result is inconsistent with the second detection result, a first prompt message can be issued. The first prompt message is used to prompt manual abnormality detection of the target person image. In this way, after receiving the first prompt message, the relevant personnel can manually detect the target face image and determine the abnormality type corresponding to the target face image.
[0136] After manually detecting the target face image, the manual detection result can be input into the optimization method server or terminal device running the image synthesis algorithm. In this way, the server or terminal device can receive the manual detection result. For example, the manual detection result can be abnormal types such as forehead distortion, messy hair abnormality, ear distortion or incomplete abnormality, facial features collapse and deformity abnormality, or no abnormality found.
[0137] Optionally, after receiving the manually input manual inspection result, a second prompt message may be sent to the model that detects the error (offline quality inspection model or abnormal interception model), and the second prompt message is used to prompt the abnormal detection error of the target face image.
[0138] For example, based on the first detection result, the second detection result and the manual detection result, it can be determined whether the offline quality inspection model or the abnormal interception model has detected an error. Then, a second prompt message is sent to the model that detected the error. In this way, the model that subsequently has a detection error can further optimize its own detection capability based on this error detection result.
[0139] Of course, the second prompt information may also be sent manually to the model that detects the error, so that the model that detects the error can receive the second prompt information.
[0140] In this way, through human-machine cross-validation, the reliability of anomaly detection results can be further improved, avoiding the impact of misjudgment due to a single model, so as to discover potential problems of the image synthesis algorithm as early as possible.
[0141] Step S414: optimizing the image synthesis algorithm based on the detection result.
[0142] Specifically, if the first detection result is inconsistent with the second detection result, the image synthesis algorithm can be optimized based on the manual detection result. If the first detection result is consistent with the second detection result, the image synthesis algorithm can be optimized based on the first detection result and / or the second detection result.
[0143] For example, if the first detection result is consistent with the second detection result, and both the first detection result and the second detection result indicate that the target face image is abnormal, the image synthesis algorithm can be optimized based on the abnormal detection result. For another example, if the manual detection result indicates that the target face image is abnormal, the image synthesis algorithm can be optimized based on the abnormal detection result.
[0144] Please continue to see Figure 4 The optimization method of the image synthesis algorithm provided in one or more embodiments of this specification may further include the following steps:
[0145] Step S416: extract at least one target face attribute information based on the target face image.
[0146] Step S418, obtaining template attribute information of the face at the same position in the template image as the target face image.
[0147] Step S420, determining whether the attribute information of each target face is consistent with the corresponding template attribute information.
[0148] Step S422: If the target face attribute information is inconsistent with the template attribute information, correct the attribute information in the template attribute information that is inconsistent with the target face attribute information.
[0149] In the template library, each face position in each template image may include a corresponding attribute information label.
[0150] For example, template image A includes three face positions, wherein the attribute information corresponding to face position F1 includes male, 18-45 years old; the attribute information corresponding to face position F2 includes female, 18-45 years old; and the attribute information corresponding to face position F3 includes male or female, 1-18 years old.
[0151] In this way, after extracting the facial attribute information of each facial image in the synthetic image to be inspected, the attribute information of the extracted face position F1 can be compared with the attribute information of the face position F1 in the template image A, the attribute information of the extracted face position F2 can be compared with the attribute information of the face position F2 in the template image A, and the attribute information of the extracted face position F3 can be compared with the attribute information of the face position F3 in the template image A.
[0152] If the target face attribute information is inconsistent with the template attribute information, the attribute information in the template attribute information that is inconsistent with the target face attribute information is corrected. For example, the target face attribute information is the attribute information corresponding to the face position F2: female, 1-18 years old. Then the template attribute information corresponding to the face position F2 in the template image A can be modified to: female, 1-18 years old.
[0153] In this way, compared with the template image, the image synthesized by the image synthesis algorithm can be regarded as closer to the real scene, and its facial attribute recognition accuracy may be higher. Therefore, using the synthesis result to correct the template data in turn will help to continuously improve the annotation quality of the template library.
[0154] It should be noted that the optimization method of the image synthesis algorithm provided in one or more embodiments of this specification can not only perform anomaly detection on face images in the synthetic image to be inspected, but also perform anomaly detection on non-face images in the synthetic image to be inspected.
[0155] Please continue to see Figure 4 In a possible implementation, anomaly detection of non-face images in the quality inspection synthetic image can be implemented in the following way:
[0156] Step S424, performing anomaly detection on the non-face image in the synthetic image to be inspected based on the template image to obtain a non-face image detection result.
[0157] Before performing anomaly detection on the synthetic image to be inspected, face images and non-face images in the synthetic image to be inspected can be extracted. The non-face image refers to the image corresponding to the remaining area after removing the face image from the synthetic image to be inspected.
[0158] Optionally, performing anomaly detection on the non-face image in the composite image to be inspected may include clarity detection of the non-face image, content anomaly detection of the non-face image, etc.
[0159] In a possible implementation, the face images in the synthetic image to be inspected and the template image can be removed to obtain the non-face images. Then, the differences between the synthetic image to be inspected and the non-face images in the template image are compared, such as the differences in clarity, content, etc.
[0160] Exemplarily, the similarity between the synthetic image to be inspected and the non-face image in the template image can be evaluated by combining a filter with a full reference metric method such as Laplacian SSIM. Specifically, the synthetic image to be inspected and the non-face image in the template image can be divided into small blocks, and the image similarity can be measured by a sliding window method to obtain the clarity detection result corresponding to the non-face image in the synthetic image to be inspected. The clarity detection result can include an overall clarity detection result and a local clarity detection result.
[0161] For example, the non-face image in the synthetic image to be inspected and the template image can be differentiated. In order to eliminate the interference of detail problems such as clarity on the detection result, the difference area can be connected and sorted at the pixel level neighborhood, and the content detection result of the non-face image in the synthetic image to be inspected can be obtained according to the degree of regional difference. Among them, the content detection can include content difference detection results and color block, color difference and other detection results.
[0162] After obtaining the non-face image detection result, the image synthesis algorithm can be optimized based on the non-face image detection result.
[0163] In this way, by inspecting areas other than faces in the quality inspection composite image for problems, problems can be automatically detected and classified, which improves the efficiency of quality inspection and provides tools for quality inspection work in the field of image synthesis.
[0164] In summary, during the above inspection process, one or more of the first detection result, the second detection result, the manual detection result, the face attribute consistency detection result, the non-face area clarity detection result, and the non-face area content anomaly detection result can be used to optimize the image synthesis algorithm, so that the optimized image synthesis algorithm can avoid the occurrence of corresponding abnormal situations as early as possible.
[0165] For example, various abnormal situations detected can be statistically analyzed, and then the causes of the various abnormal situations can be analyzed. Then, based on the causes of the various abnormal situations, the relevant modules in the synthesis algorithm can be optimized.
[0166] The method for optimizing the image synthesis algorithm provided in one or more embodiments of this specification can perform the above-mentioned optimization process once or multiple times to optimize the image synthesis algorithm before the relevant functions of the image synthesis algorithm are put into use. It is also possible to batch inspect the real historical synthetic images after the relevant functions of the image synthesis algorithm are put into use, so as to discover as many abnormal problems as possible that have not been discovered before. Then, the image synthesis algorithm can be continuously iterated and optimized based on the newly discovered abnormal problems. For example, the quality inspection of the synthetic images to be inspected using the optimized image synthesis algorithm can increase the yield rate of the synthetic images to be inspected from the original 62% to about 95%.
[0167] In this way, after the relevant functions of the optimized image synthesis algorithm are put into use, the yield rate of the synthesized image can be greatly improved when performing image synthesis based on the optimized image synthesis algorithm. For example, the yield rate of the synthesized image can be maintained at about 93%.
[0168] The following describes an embodiment of an image generation method provided by one or more embodiments of this specification.
[0169] See also Figure 5 , Figure 5 This is a flow chart of an image generation method provided in one or more embodiments of this specification. The method can be applied to a server or a terminal device. Figure 5 As shown, the method may include the following steps:
[0170] Step S502: receiving a user image uploaded by a user.
[0171] Step S504: Determine the template image selected by the user.
[0172] Step S506: Generate a composite image based on the user image and the template image using the optimized image synthesis algorithm.
[0173] The user image, the template image and the optimized image synthesis algorithm can refer to the description of the above embodiment and will not be described again here.
[0174] In this way, since the optimized image synthesis algorithm has already optimized the possible abnormal situations in advance, generating a synthetic image based on the optimized image synthesis algorithm can improve the yield rate of the synthetic image, thereby improving the user experience of the image synthesis function.
[0175] Optionally, after receiving the user image uploaded by the user, anomaly detection may be performed on the face image in the user image to filter the quality of the face in the user image.
[0176] Exemplarily, the quality filtering may be performed on the blur degree, lighting conditions and other attributes of the face image in the user image. For example, the parameters related to the blur degree, lighting conditions and other attributes of the face image in the user image may be compared with the corresponding thresholds. If all attributes meet the quality requirements, it may be determined that the face image is normal. If one attribute does not meet the quality requirements, it may be determined that the face image is abnormal.
[0177] Exemplarily, the posture of the face image in the user image can also be estimated. If the face image is a face with a large posture such as side profile or head down, it can be determined that the face image is abnormal. Among them, a face with a large posture can be understood as a face with a posture greater than a posture threshold.
[0178] Exemplarily, the facial image in the user image may also be subjected to abnormal detection such as large expressions, non-face image areas, etc. Among them, large expressions may be understood as expressions that may lead to deviations in positioning of facial key points, such as exaggerated expressions such as opening the mouth wide.
[0179] In this way, after the above abnormal detection of the user image, if the face image and / or the non-face area in the user image is normal, the subsequent process can be executed. If the face image and / or the non-face area in the user image is abnormal, a fourth prompt information can be generated, and the fourth prompt information is used to prompt the user that the user image uploaded is abnormal.
[0180] For example, if an abnormal face image is detected in the user image, a fourth prompt message may be displayed on the display interface of the terminal device or the fourth prompt message may be broadcasted by voice. For example, the fourth prompt message is: the posture of the face image in the uploaded image is too large, please re-upload an image that meets the requirements.
[0181] In this way, before generating the composite image, the user image uploaded by the user is first screened for quality, and after the user image passes the quality screening, the composite image is generated using the image synthesis algorithm. In this way, the situation where the composite image quality is poor due to unqualified user images can be reduced.
[0182] Optionally, after generating the synthetic image, the anomaly interception model trained by the above embodiment may be used to perform anomaly detection on the face image in the synthetic image.
[0183] It should be noted that the trained anomaly interception model can be used to perform anomaly detection on one or more face images in the composite image. The following takes anomaly detection on a target face image in the composite image as an example, where the target face image is any face image in the composite image.
[0184] Based on the above description of the abnormal interception model, it can be known that the target face image in the synthetic image can be input into the abnormal interception model. Then, the abnormal interception model can output the corresponding normal score. If the normal score is greater than the normal threshold, it can be determined that the target face image is normal; if the normal score is less than or equal to the normal threshold, it can be determined that the target face image is abnormal.
[0185] According to the above-mentioned method for detecting the target face image, abnormality detection can be performed on one or more face images in the composite image.
[0186] If the facial image is detected to be abnormal, a third prompt message may be generated, and the third prompt message is used to prompt that the composite image is abnormal. For example, the third prompt message may be: the composite image is abnormal, please re-upload the user image. If the facial images are detected to be normal, the composite image is displayed.
[0187] That is to say, when one or more facial images are detected to be abnormal, the abnormal composite image will not be displayed on the display interface of the terminal device. When one or more facial images are detected to be normal, the normal composite image will be displayed on the display interface of the terminal device. In this way, through the abnormal interception model, the abnormal composite image can be intercepted to avoid the abnormal composite image from being transmitted to the user, so that the quality of the displayed composite image can be controlled and the user experience is improved.
[0188] It should be noted that the description of the anomaly interception model can be found in the above description of the training method of the anomaly interception model, which will not be repeated here.
[0189] In the image synthesis method provided in one or more embodiments of the present specification, a synthesized image is generated based on an optimized image synthesis algorithm. Since the optimized image synthesis algorithm has already optimized possible abnormal situations in advance, the optimized image synthesis algorithm can improve the yield rate of the synthesized image, thereby improving the user experience of the image synthesis function.
[0190] Secondly, before generating a synthetic image, quality inspection can be performed on the uploaded user image's attributes such as blurriness, lighting conditions, and abnormal conditions such as large-pose faces, large expressions, and non-face image areas, in order to screen user images that are suitable for generating synthetic images, thereby improving the yield rate of synthetic images.
[0191] Secondly, after the synthetic image is generated, a lightweight anomaly interception model can be used to quickly detect anomalies in the synthetic image. In this way, the abnormal synthetic image can be intercepted by the anomaly interception model to avoid the abnormal synthetic image from being shown to the user, thereby making the quality of the displayed synthetic image controllable and improving the user experience.
[0192] It can be understood that the above embodiments are only examples and can be modified in actual implementation. Those skilled in the art can understand that the modification methods of the above embodiments without creative labor fall within the protection scope of one or more embodiments of this specification and will not be repeated in the embodiments.
[0193] Based on the same inventive concept, one or more embodiments of the present specification also provide an optimization device for an image synthesis algorithm. Since the principle of solving the problem by the optimization device for the image synthesis algorithm is similar to the optimization method for the aforementioned image synthesis algorithm, the implementation of the optimization device for the image synthesis algorithm can refer to the implementation of the optimization method for the aforementioned image synthesis algorithm, and the repeated parts will not be repeated.
[0194] See also Figure 6 , Figure 6This is a structural block diagram of an optimization device for an image synthesis algorithm provided in one or more embodiments of this specification. Figure 6 As shown, the image synthesis algorithm optimization device 600 may include: a first acquisition module 601, a first detection module 602, and an optimization module 603.
[0195] The first acquisition module 601 may be used to acquire a composite image to be inspected, where the composite image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm.
[0196] The first detection module 602 can be used to perform abnormality detection on the target face image in the synthetic image to be inspected using an offline quality inspection model to obtain a first detection result; the target face image is any face image in the synthetic image to be inspected.
[0197] The optimization module 603 may be configured to optimize the image synthesis algorithm based on the first detection result.
[0198] In one possible implementation, the device also includes: a second detection module, used to use an abnormality interception model to perform abnormality detection on the target face image to obtain a second detection result; a first sending module, used to send a first prompt message if the first detection result is inconsistent with the second detection result, and the first prompt message is used to prompt manual abnormality detection on the target person image; a first receiving module, used to receive manually input manual detection results; the optimization module is also used to optimize the image synthesis algorithm based on the manual detection results.
[0199] In one possible implementation, the first detection result is the abnormality type corresponding to the target facial image, and the second detection result is the normal score corresponding to the target facial image; wherein, when the normal score is greater than the normal threshold, the second detection result is that the target facial image is normal; when the normal score is less than or equal to the normal threshold, the second detection result is that the target facial image is abnormal.
[0200] In a possible implementation, the optimization module 603 is further configured to optimize the image synthesis algorithm based on the first detection result and / or the second detection result if the first detection result is consistent with the second detection result.
[0201] In one possible implementation, the device also includes: a second sending module, used to send a second prompt message to the model with an abnormality detection error, the second prompt message is used to prompt an abnormality detection error for the target face image; the model with an abnormality detection error is the offline quality inspection model or the abnormality interception model.
[0202] In one possible implementation, the device also includes: an extraction module, used to extract at least one target face attribute information based on the target face image; a fourth acquisition module, used to obtain the template attribute information of the face at the same position as the target face image in the template image; a third determination of whether each target face attribute information is consistent with the corresponding template attribute information; and a correction module, used to correct the attribute information in the template attribute information that is inconsistent with the target face attribute information if the target face attribute information is inconsistent with the template attribute information.
[0203] In one possible implementation, the device also includes: a fourth detection module, used to perform anomaly detection on the non-face image in the synthetic image to be inspected based on the template image, and obtain a non-face image detection result; an optimization module 603, also used to optimize the image synthesis algorithm based on the non-face image detection result.
[0204] In one possible implementation, the fourth detection module is used to perform anomaly detection on the non-face image in the synthetic image to be inspected based on the template image, and obtain a non-face image detection result; specifically: the fourth detection module is used to perform anomaly detection on the clarity and / or content of the non-face image in the synthetic image to be inspected based on the template image, and obtain a clarity detection result and / or a content anomaly detection result.
[0205] In a possible implementation, the offline quality inspection model is a pre-trained visual-language pre-trained model, and the detection accuracy of the offline quality inspection model is higher than the detection accuracy of the abnormal interception model.
[0206] Based on the same inventive concept, one or more embodiments of the present specification also provide an image generating device. Since the principle of solving the problem by the image generating device is similar to that of the aforementioned image generating method, the implementation of the image generating device can refer to the implementation of the aforementioned image generating method, and the repeated parts will not be repeated.
[0207] See also Figure 7 , Figure 7 This is a structural block diagram of an image generation device provided by one or more embodiments of this specification. Figure 7 As shown, the image generation device 700 may include: a second receiving module 701, a first determining module 702 and a generating module 703.
[0208] The second receiving module 701 is used to receive a user image uploaded by a user.
[0209] The first determining module 702 is used to determine the template image selected by the user.
[0210] The generation module 703 is used to generate a composite image based on the user image and the template image by using the optimized image synthesis algorithm.
[0211] In one possible implementation, the device also includes: a third detection module, used to use an abnormality interception model to perform abnormality detection on the target facial image in the composite image; the target facial image is any one or more facial images in the composite image; a generation module, used to generate third prompt information if the target facial image is abnormal, and the third prompt information is used to indicate that the composite image is abnormal; and a display module, used to display the composite image if the target facial image is normal.
[0212] In one possible implementation, the third detection module is used to perform anomaly detection on the target face image in the composite image using an anomaly interception model; specifically: the third detection module is used to determine the normal score of the target face image using the anomaly interception model; if the normal score is greater than the normal threshold, it is determined that the target face image in the composite image is normal; if the normal score is less than or equal to the normal threshold, it is determined that the target face image in the composite image is abnormal.
[0213] In one possible implementation, the device also includes a fifth detection module, which is used to perform abnormality detection on the user image; if the user image is normal, a composite image is generated based on the user image and the template image using an optimized image synthesis algorithm; if there is an abnormality in the user image, a fourth prompt information is generated, and the fourth prompt information is used to indicate that the user image is abnormal.
[0214] Based on the same inventive concept, one or more embodiments of the present specification also provide a training device for an offline quality inspection model. Since the principle of the problem solved by the training device for the offline quality inspection model is similar to that of the aforementioned training method for the offline quality inspection model, the implementation of the training device for the offline quality inspection model can refer to the implementation of the aforementioned training method for the offline quality inspection model, and the repeated parts will not be repeated.
[0215] See also Figure 8 , Figure 8 This is a structural block diagram of a training device for an offline quality inspection model provided in one or more embodiments of this specification. Figure 8 As shown, the training device 800 of the offline quality inspection model may include: a second acquisition module 801, a third acquisition module 802, an output module 803, a second determination module 804 and a training module 805.
[0216] The second acquisition module 801 is used to acquire training data; wherein the training data includes sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images.
[0217] The third acquisition module 802 is used to acquire an abnormality detection instruction.
[0218] The output module 803 is used to use the sample image and the anomaly detection instruction as inputs of the offline quality inspection model and output anomaly description information.
[0219] The second determination module 804 is used to determine the predicted abnormality type corresponding to the sample image based on the abnormality description information.
[0220] The training module 805 is used to train the offline quality inspection model until convergence based on the real abnormality type and the predicted abnormality type to obtain a trained offline quality inspection model.
[0221] In a possible implementation, the anomaly detection instruction includes an anomaly detection instruction corresponding to at least one language.
[0222] See also Fig. 9 , Fig. 9 This is a structural block diagram of an electronic device provided in one or more embodiments of this specification. Fig. 9 As shown, the electronic device 900 may include a processor 901 and a memory 902; the memory 902 may be coupled to the processor 901. It is worth noting that the Fig. 9 is exemplary; other types of structures may also be used to supplement or replace this structure to implement telecommunication functions or other functions.
[0223] In a possible implementation, the functions of the image synthesis algorithm optimization device 600 , the image generation device 700 , or the offline quality inspection model training device 800 may be integrated into the processor 901 .
[0224] The processor 901 may be configured to perform the following operations:
[0225] Acquire a composite image to be inspected, where the composite image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm;
[0226] Using an offline quality inspection model, an abnormality detection is performed on a target face image in the synthetic image to be inspected to obtain a first detection result; the target face image is any face image in the synthetic image to be inspected;
[0227] The image synthesis algorithm is optimized based on the first detection result.
[0228] Alternatively, the processor 901 may be configured to perform the following operations:
[0229] Receiving user images uploaded by users;
[0230] Determine the template image selected by the user;
[0231] A composite image is generated based on the user image and the template image using an optimized image synthesis algorithm.
[0232] Alternatively, the processor 901 may be configured to perform the following operations:
[0233] Acquire training data; wherein the training data includes sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images;
[0234] Get anomaly detection instructions;
[0235] Taking the sample image and the anomaly detection instruction as inputs of the offline quality inspection model, and outputting anomaly description information;
[0236] Based on the abnormality description information, determining the predicted abnormality type corresponding to the sample image;
[0237] Based on the actual abnormality type and the predicted abnormality type, the offline quality inspection model is trained until convergence to obtain a trained offline quality inspection model.
[0238] In another possible implementation, the image synthesis algorithm optimization device 600, the image generation device 700 or the offline quality inspection model training device 800 may be configured separately from the processor 901. For example, the image synthesis algorithm optimization device 600, the image generation device 700 or the offline quality inspection model training device 800 may be configured as a chip connected to the processor 901, and the image synthesis algorithm optimization, image generation or offline quality inspection model training may be implemented through the control of the processor 901.
[0239] In addition, in some optional implementations, the electronic device 900 may also include: a communication module, an input unit, an audio processor, a display, a power supply, etc. It is worth noting that the electronic device 900 does not necessarily include Fig. 9 In addition, the electronic device 900 may also include Fig. 9 For components not shown, reference may be made to the prior art.
[0240] In some optional implementations, the processor 901 is sometimes also referred to as a controller or operation control, and may include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of various components of the electronic device 900.
[0241] The memory 902 may be, for example, a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory or other suitable devices. The memory 902 may store the information related to the optimization device 600, the image generation device 700 or the training device 800 of the offline quality inspection model, and may also store a program for executing the related information. The processor 901 may execute the program stored in the memory 902 to implement information storage or processing.
[0242] The input unit can provide input to the processor 901. The input unit is, for example, a key or a touch input device. The power supply can be used to provide power to the electronic device 900. The display can be used to display display objects such as images and text. The display can be, for example, an LCD display, but is not limited thereto.
[0243] The memory 902 may be a solid-state memory, such as a read-only memory (ROM), a random access memory (RAM), a SIM card, etc. It may also be a memory that stores information even when the power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROMs, etc. The memory 902 may also be some other type of device. The memory 902 includes a buffer memory (sometimes referred to as a buffer). The memory 902 may include an application / function storage unit for storing application programs and function programs or processes for executing the operation of the electronic device 900 through the processor 901.
[0244] The memory 902 may also include a data storage unit for storing data, such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. The driver storage unit of the memory 902 may include various drivers for the communication function of the computer device and / or for executing other functions of the computer device (such as a messaging application, a contact book application, etc.).
[0245] The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor 901 to provide input signals and receive output signals, which may be the same as in a conventional mobile communication terminal.
[0246] Based on different communication technologies, multiple communication modules may be provided in the same computer device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to the processor 901, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.
[0247] One or more embodiments of the present specification also provide a computer-readable storage medium capable of implementing all the steps in the method for optimizing the image synthesis algorithm, the method for generating an image, or the method for training an offline quality inspection model in the above embodiments. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the computer program implements all the steps in the method for optimizing the image synthesis algorithm, the method for generating an image, or the method for training an offline quality inspection model in the above embodiments. For example, when the processor executes the computer program, the following steps are implemented:
[0248] Acquire a composite image to be inspected, where the composite image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm;
[0249] Using an offline quality inspection model, an abnormality detection is performed on a target face image in the synthetic image to be inspected to obtain a first detection result; the target face image is any face image in the synthetic image to be inspected;
[0250] The image synthesis algorithm is optimized based on the first detection result.
[0251] Alternatively, the processor implements the following steps when executing the computer program:
[0252] Receiving user images uploaded by users;
[0253] Determine the template image selected by the user;
[0254] A composite image is generated based on the user image and the template image using an optimized image synthesis algorithm.
[0255] Alternatively, the processor implements the following steps when executing the computer program:
[0256] Acquire training data; wherein the training data includes sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images;
[0257] Get anomaly detection instructions;
[0258] Taking the sample image and the anomaly detection instruction as inputs of the offline quality inspection model, and outputting anomaly description information;
[0259] Based on the abnormality description information, determining the predicted abnormality type corresponding to the sample image;
[0260] Based on the actual abnormality type and the predicted abnormality type, the offline quality inspection model is trained until convergence to obtain a trained offline quality inspection model.
[0261] Although one or more embodiments of this specification provide method operation steps as described in the embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative labor. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent the only execution order. When the actual device or client product is executed, it can be executed in the order of the method shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0262] It should be understood by those skilled in the art that the embodiments of this specification may be provided as methods, devices (systems) or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
[0263] One or more embodiments of the present specification are described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to one or more embodiments of the present specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0264] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0265] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0266] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0267] In this article, relational terms such as first and second, etc. are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. For those of ordinary skill in the art, the specific meaning of the above terms in one or more embodiments of this specification can be understood according to the specific circumstances.
[0268] It should be noted that, in the absence of conflict, one or more embodiments of this specification and the features in the embodiments may be combined with each other. One or more embodiments of this specification are not limited to any single aspect, nor to any single embodiment, nor to any combination and / or replacement of these aspects and / or embodiments. Moreover, each aspect and / or embodiment of one or more embodiments of this specification may be used alone or in combination with one or more other aspects and / or embodiments thereof.
[0269] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of one or more embodiments of this specification, rather than to limit them. Although one or more embodiments of this specification are described in detail with reference to the aforementioned embodiments, a person of ordinary skill in the art should understand that the technical solutions described in the aforementioned embodiments can still be modified, or some or all of the technical features therein can be replaced by equivalents. These modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of one or more embodiments of this specification, and they should all be included in the scope of the claims and the specification of one or more embodiments of this specification.
[0270] One or more embodiments of this specification are described above in conjunction with optional implementation methods, but these implementation methods are only exemplary and serve only as an illustration. On this basis, multiple replacements and improvements can be made to one or more embodiments of this specification, all of which fall within the scope of protection of one or more embodiments of this specification.
Claims
1. A method for optimizing an image synthesis algorithm, characterized in that: The method comprises: Acquire a composite image to be inspected, where the composite image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm; Using an offline quality inspection model, an abnormality detection is performed on a target face image in the synthetic image to be inspected to obtain a first detection result; the target face image is any face image in the synthetic image to be inspected; The image synthesis algorithm is optimized based on the first detection result.
2. The method according to claim 1, characterized in that The method further comprises: Performing anomaly detection on the target face image using an anomaly interception model to obtain a second detection result; If the first detection result is inconsistent with the second detection result, sending a first prompt message, wherein the first prompt message is used to prompt a human to perform an abnormality detection on the target person image; receiving manual inspection results input by humans; The image synthesis algorithm is optimized based on the manual detection result.
3. The method according to claim 2, characterized in that The method further comprises: If the first detection result is consistent with the second detection result, the image synthesis algorithm is optimized based on the first detection result and / or the second detection result.
4. The method according to claim 2 or 3, characterized in that The first detection result is the abnormality type corresponding to the target facial image, and the second detection result is the normal score corresponding to the target facial image; wherein, when the normal score is greater than the normal threshold, the second detection result is that the target facial image is normal; when the normal score is less than or equal to the normal threshold, the second detection result is that the target facial image is abnormal.
5. The method according to claim 2, characterized in that After receiving the manually input manual detection result, the method further includes: A second prompt message is sent to the model with an abnormality detection error, where the second prompt message is used to prompt an abnormality detection error for the target facial image; the model with an abnormality detection error is the offline quality inspection model or the abnormality interception model.
6. The method according to claim 1, characterized in that The method further comprises: Based on the target face image, extract at least one target face attribute information; Acquire template attribute information of a face at the same position as the target face image in the template image; Determining whether each target face attribute information is consistent with the corresponding template attribute information; If the target face attribute information is inconsistent with the template attribute information, the attribute information in the template attribute information that is inconsistent with the target face attribute information is corrected.
7. The method according to claim 1 or 6, characterized in that The method further comprises: Based on the template image, performing anomaly detection on the non-face image in the synthetic image to be inspected to obtain a non-face image detection result; The image synthesis algorithm is optimized based on the non-face image detection result.
8. The method according to claim 7, characterized in that The method of performing abnormality detection on the non-face image in the synthetic image to be inspected based on the template image to obtain a non-face image detection result includes: Based on the template image, an abnormality detection is performed on the clarity and / or content of the non-face image in the synthetic image to be inspected, and a clarity detection result and / or a content abnormality detection result is obtained.
9. The method according to claim 2, characterized in that The offline quality inspection model is a pre-trained visual-language pre-trained model, and the detection accuracy of the offline quality inspection model is higher than the detection accuracy of the abnormal interception model.
10. An image generation method, characterized in that: The method comprises: Receive user images uploaded by users; Determine the template image selected by the user; Using the image synthesis algorithm optimized by the method as described in any one of claims 1 to 9, a synthetic image is generated based on the user image and the template image.
11. The method according to claim 10, characterized in that After generating a synthesized image based on the user image and the template image using the image synthesis algorithm optimized by the method according to any one of claims 1 to 9, the method further comprises: Using an anomaly interception model, anomaly detection is performed on a target face image in the composite image; the target face image is any one or more face images in the composite image; If the target face image is abnormal, generating third prompt information, wherein the third prompt information is used to prompt that the synthesized image is abnormal; If the target face image is normal, the synthesized image is displayed.
12. The method according to claim 11, characterized in that The using of the abnormal interception model to perform abnormality detection on the target face image in the synthetic image includes: Determining a normal score for each of the target face images using an anomaly interception model; If the normal score is greater than the normal threshold, it is determined that the target face image in the composite image is normal; If the normal score is less than or equal to the normal threshold, it is determined that the target face image in the composite image is abnormal.
13. The method according to any one of claims 10 to 12, characterized in that Before generating a synthesized image based on the user image and the template image using the image synthesis algorithm optimized by the method according to any one of claims 1 to 9, the method further comprises: Performing anomaly detection on the user image; If the user image is normal, generating a composite image based on the user image and the template image using an image synthesis algorithm optimized by the method according to any one of claims 1 to 9; If there is an abnormality in the user image, fourth prompt information is generated, and the fourth prompt information is used to prompt that the user image is abnormal.
14. A method for training an offline quality inspection model, characterized in that: The offline quality inspection model is a vision-language pre-training model, and the method comprises: Acquire training data; wherein the training data includes sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images; Get anomaly detection instructions; Taking the sample image and the anomaly detection instruction as inputs of the offline quality inspection model, and outputting anomaly description information; Based on the abnormality description information, determining the predicted abnormality type corresponding to the sample image; Based on the actual abnormality type and the predicted abnormality type, the offline quality inspection model is trained until convergence to obtain a trained offline quality inspection model.
15. The method according to claim 14, characterized in that The abnormality detection instructions include abnormality detection instructions corresponding to at least one language.
16. An optimization device for an image synthesis algorithm, characterized in that: The device comprises: A first acquisition module is used to acquire a composite image to be inspected, where the composite image to be inspected is an image synthesized based on a user image and a template image using an image synthesis algorithm; A first detection module, configured to perform abnormality detection on a target face image in the composite image to be inspected using an offline quality inspection model to obtain a first detection result; the target face image is any face image in the composite image to be inspected; An optimization module is used to optimize the image synthesis algorithm based on the first detection result.
17. The device according to claim 16, characterized in that The device also includes: A second detection module, used to perform anomaly detection on the target face image using an anomaly interception model to obtain a second detection result; A first sending module, configured to send a first prompt message if the first detection result is inconsistent with the second detection result, wherein the first prompt message is used to prompt a human to perform an abnormality detection on the target person image; A first receiving module, used for receiving a manual inspection result input manually; The optimization module is further used to optimize the image synthesis algorithm based on the manual detection result.
18. The device according to claim 17, characterized in that The first detection result is the abnormality type corresponding to the target facial image, and the second detection result is the normal score corresponding to the target facial image; wherein, when the normal score is greater than the normal threshold, the second detection result is that the target facial image is normal; when the normal score is less than or equal to the normal threshold, the second detection result is that the target facial image is abnormal.
19. The device according to claim 17, characterized in that The device also includes: The second sending module is used to send a second prompt message to the model with an abnormality detection error, wherein the second prompt message is used to prompt an abnormality detection error for the target facial image; the model with an abnormality detection error is the offline quality inspection model or the abnormality interception model.
20. The device according to claim 17, characterized in that The offline quality inspection model is a pre-trained visual-language pre-trained model, and the detection accuracy of the offline quality inspection model is higher than the detection accuracy of the abnormal interception model.
21. An image generating device, characterized in that: The device comprises: A second receiving module, used to receive a user image uploaded by a user; A first determining module, used to determine the template image selected by the user; A generation module, configured to generate a composite image based on the user image and the template image using an image synthesis algorithm optimized by the method according to any one of claims 1 to 9.
22. The device according to claim 21, characterized in that The device also includes: A third detection module is used to perform anomaly detection on a target face image in the composite image using an anomaly interception model; the target face image is any face image in the composite image; A generating module, configured to generate third prompt information if the target face image is abnormal, wherein the third prompt information is used to indicate that the synthesized image is abnormal; A display module is used to display the synthesized image if the target face image is normal.
23. A training device for an offline quality inspection model, characterized in that: The offline quality inspection model is a vision-language pre-training model, and the device comprises: A second acquisition module is used to acquire training data; wherein the training data includes sample images and real abnormality types corresponding to the sample images, and the sample images include normal images and abnormal images; A third acquisition module is used to acquire an abnormality detection instruction; An output module, used to use the sample image and the anomaly detection instruction as inputs of the offline quality inspection model and output anomaly description information; A second determination module, configured to determine a predicted abnormality type corresponding to the sample image based on the abnormality description information; A training module is used to train the offline quality inspection model until convergence based on the real abnormality type and the predicted abnormality type to obtain a trained offline quality inspection model.
24. An electronic device, characterized in that: The electronic device comprises: a memory for storing a computer program product; A processor, configured to execute a computer program product stored in the memory, wherein when the computer program product is executed, the method described in any one of claims 1 to 9, 10 to 13 or 14 to 15 is implemented.
25. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed, implement the method described in any one of claims 1-9, 10-13 or 14-15.
