Image processing method and model training method, device, equipment and medium

By training and parameter adjustment of sample images of multiple image types, the problem of low accuracy of image processing for multiple types of images in the prior art is solved, and the applicability and accuracy of image processing models are improved.

CN113505800BActive Publication Date: 2024-11-01XINJIANG SHENGLIAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110735895.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2024-11-01
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

The existing image processing model can only process a single image type and cannot effectively process multiple types of images, resulting in reduced processing accuracy and inability to meet daily needs.

Method used

By acquiring sample images of multiple image types for training, the parameters of the image processing model are adjusted using the annotation results and prediction results, so that the model can adapt to multiple types of image processing.

Benefits of technology

The applicability and accuracy of the image processing model is improved, so that the model can process different types of images more accurately and is suitable for daily life and work scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113505800B_ABST
    Figure CN113505800B_ABST
Patent Text Reader

Abstract

The present application discloses an image processing method and a training method, device, equipment, and medium for its model. The training method for the image processing model includes: obtaining multiple sample images, wherein the multiple sample images belong to at least two image types, and the sample images correspond to annotation results, and the annotation results of the sample images include real information about the content of the sample images; using the image processing model to process each sample image respectively to obtain a prediction result of each sample image, wherein the prediction result of the sample image includes prediction information about the content of the sample image; adjusting the parameters of the image processing model based on the annotation results and prediction results of each sample image. The above scheme can improve the applicability of the image processing model by training the model with sample images of multiple image types.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to an image processing method and a training method, device, equipment, and medium for its model. Background Art

[0002] At present, with the progress of society, people have put forward higher demands for convenience in life and work. For example, in the field of image processing technology, the existing image processing model can only process images of a single image type. Once other types of models are input into the image processing model, the accuracy of the image processing model will be relatively reduced, which cannot meet the needs of daily work. Summary of the invention

[0003] The present application at least provides an image processing method and a training method, device, equipment, and medium for its model.

[0004] The present application provides a training method for an image processing model, comprising obtaining a plurality of sample images, wherein the plurality of sample images belong to at least two image types, and the sample images correspond to annotation results, and the annotation results of the sample images include real information about the content of the sample images; using the image processing model to process each sample image respectively to obtain a prediction result of each sample image, wherein the prediction result of the sample image includes prediction information about the content of the sample image; and adjusting the parameters of the image processing model based on the annotation results and prediction results of each sample image.

[0005] Therefore, by using sample images of various image types to train the image processing model, the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0006] Among them, the image processing model includes at least one of a target classification model and a saliency detection model; when the image processing model is a target classification model, the true information is the true category of the target in the sample image, and the predicted information includes the predicted category of the target in the sample image; when the image processing model is a saliency detection model, the true information is the true position information about the salient area in the sample image, and the predicted information includes the predicted position information about the salient area in the sample image.

[0007] Therefore, by using sample images of multiple image types to train the target classification model, the trained target classification model can classify targets for multiple types of images, thereby improving the applicability of the target classification model. Also, by using sample images of multiple image types to train the saliency detection model, the trained saliency detection model can perform saliency detection for multiple types of images, thereby improving the applicability of the saliency detection model.

[0008] The annotation information of the sample image also includes the real image type of the sample image, and the prediction result of the sample image includes the predicted image type of the sample image.

[0009] Therefore, by adjusting the parameters of the image processing model in combination with the actual image type of the sample image and the predicted image type of the sample image, the distance between the features extracted from images containing the same target but belonging to different image types can be made closer in the feature space, thereby making the adjusted image processing model more accurate in predicting the content of images of different image types.

[0010] Among them, based on the labeling results and prediction results of each sample image, the parameters of the image processing model are adjusted, including: obtaining a first loss based on real information and predicted information, and obtaining a second loss based on the real image type and the predicted image type; based on the first loss and the second loss, the parameters of the image processing model are adjusted.

[0011] Therefore, by adjusting the parameters of the image processing model using a first loss between the real information about the content of the sample image and the predicted information of its content and a second loss based on the real image type and the predicted image type, the prediction accuracy of the trained image processing model can be improved.

[0012] Wherein, adjusting the parameters of the image processing model based on the first loss and the second loss includes: obtaining the loss difference between the first loss and the second loss; and adjusting the parameters of the image processing model using the loss difference and the second loss.

[0013] Therefore, by using the loss difference between the first loss and the second loss and the second loss to adjust the parameters of the image processing model, the prediction accuracy of the trained image processing model can be improved.

[0014] Among them, the image processing model is a target classification model, and the target classification model includes a feature extraction network, a target classification network and an image type classification network; the image processing model is used to process each sample image to obtain a prediction result of each sample image, including: using the feature extraction network to extract features of the sample image to obtain sample features; using the target classification network to perform target classification on the sample features to obtain prediction information of the sample image; using the image type classification network to perform image type classification on the sample features to obtain the predicted image type of the sample image; using the loss difference and the second loss to adjust the parameters of the image processing model, including: using the second loss to adjust the parameters of the image type classification network; using the loss difference to adjust the parameters of the feature extraction network and the target classification network.

[0015] Therefore, by using the loss difference to adjust the feature extraction network and the target classification network in the image processing model, the image processing model can obtain more accurate prediction information about the content of the sample image, and by using the second loss to adjust the parameters of the image type classification network, the accuracy of the image type classification network can be improved.

[0016] The method comprises the following steps: processing each sample image using an image processing model to obtain a prediction result of each sample image, and adjusting the parameters of the image processing model based on the annotation results and the prediction results of each sample image, including: selecting several sample images from multiple sample images as current sample images; wherein the image types to which the several sample images belong include all image types of the multiple sample images; processing the current sample image using the image processing model to obtain a prediction result in the current sample image; adjusting the parameters of the image processing model based on the annotation results and the prediction results of the current sample image; and repeating the steps of selecting several sample images from multiple sample images as current sample images and subsequent steps until the image processing model meets the preset requirements.

[0017] Therefore, several sample images are selected from multiple sample images as current sample images, and the current sample images are processed by the image processing model, so as to train the image processing model in batches. Moreover, each batch of training ensures the presence of sample images of all image types, which can improve the training effect of each batch on the image processing model.

[0018] The image type includes one or more of an image obtained by photographing the target, a hand-drawn picture, and a cartoon picture.

[0019] Therefore, by using sample images corresponding to common image types to train the image processing model, the trained image processing model is more applicable in daily life or work.

[0020] The present application provides an image processing method, comprising: obtaining an image to be processed; processing the image to be processed using an image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model is trained using the above-mentioned image processing model training method.

[0021] Therefore, by using the image processing model trained by the above-mentioned image processing model training method to process the image to be processed, the accuracy of image processing can be improved.

[0022] Among them, the image processing model includes at least one of a target classification model and a saliency detection model; when the image processing model is a target classification model, the prediction information is the predicted category of the target in the image to be processed; when the image processing model is a saliency detection model, the prediction information is the predicted position information about the salient area in the image to be processed.

[0023] Therefore, by using the target classification model trained by the training method of the above image processing model to process the image to be processed, the predicted category of the target obtained is more accurate. And / or, by using the saliency detection model trained by the training method of the above image processing model to process the image to be processed, the predicted position information about the salient area obtained is more accurate.

[0024] Among them, in the case where the image processing model is a target classification model, after using the image processing model to process the image to be processed and obtaining predicted information about the content of the image to be processed, the method also includes at least one of the following: displaying the predicted category on the interface displaying the image to be processed; selecting audio matching the predicted category for playing; selecting a source bone matching the predicted category, and migrating the first animation driving data related to the source bone to the target bone to obtain the second animation driving data of the target bone, wherein the target bone is obtained by bone extraction based on the target in the image to be processed.

[0025] Therefore, after obtaining the prediction information, at least one of the above steps is performed to achieve further intelligent operation of the classification result of the image processing model.

[0026] Among them, when the image processing model is a saliency detection model, after using the image processing model to process the image to be processed and obtaining prediction information about the content of the image to be processed, the method also includes: using the predicted position information to extract bones from the salient area to obtain a target bone; selecting a bone model as a source bone for the target bone; migrating the first animation driving data related to the source bone to the target bone to obtain the second animation driving data of the target bone.

[0027] Therefore, by using the saliency detection model trained by the training method of the above-mentioned image processing model to output the saliency region, and using this to perform bone extraction on the saliency region to obtain the target bone, the obtained target bone is more accurate.

[0028] The present application provides a training device for an image processing model, comprising: a first acquisition module, used to acquire multiple sample images, wherein the multiple sample images belong to at least two image types, and the sample images correspond to annotation results, and the annotation results of the sample images include real information about the content of the sample images; a first image processing module, used to process each sample image using the image processing model respectively to obtain a prediction result of each sample image, wherein the prediction result of the sample image includes prediction information about the content of the sample image; an adjustment module, used to adjust the parameters of the image processing model based on the annotation results and prediction results of each sample image.

[0029] The present application provides an image processing device, including: a second acquisition module, used to acquire an image to be processed; a second image processing module, used to process the image to be processed using an image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model is trained by the training method of the above-mentioned image processing model.

[0030] The present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned image processing model training method and / or image processing method.

[0031] The present application provides a computer-readable storage medium having program instructions stored thereon, which, when executed by a processor, implement the above-mentioned image processing model training method and / or image processing method.

[0032] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0033] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0035] Figure 1 It is a flowchart of an embodiment of a training method for an image processing model of the present application;

[0036] Figure 2 is a schematic diagram showing an image obtained by photographing a target in an embodiment of a training method for an image processing model of the present application;

[0037] Figure 3 is a schematic diagram of a hand-drawn picture shown in an embodiment of a training method for an image processing model of the present application;

[0038] Figure 4 It is a schematic diagram of a cartoon image shown in an embodiment of a training method for an image processing model of the present application;

[0039] Figure 5 It is a flowchart of an embodiment of the image processing method of the present application;

[0040] Figure 6 is a first schematic diagram showing a mapping relationship in an embodiment of the image processing method of the present application;

[0041] Figure 7 is a second schematic diagram showing a mapping relationship in an embodiment of the image processing method of the present application;

[0042] Figure 8 is a third schematic diagram showing a mapping relationship according to an embodiment of the image processing method of the present application;

[0043] Fig. 9 It is a structural schematic diagram of an embodiment of a training device for an image processing model of the present application;

[0044] Fig.10 is a structural schematic diagram of an embodiment of an image processing device of the present application;

[0045] Fig.11 It is a structural schematic diagram of an embodiment of the electronic device of the present application;

[0046] Fig.12 It is a structural diagram of an embodiment of a computer-readable storage medium of the present application. DETAILED DESCRIPTION

[0047] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0048] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0049] The term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the objects associated before and after are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0050] The present application can be applied to devices with image processing capabilities. In addition, the device may have image acquisition or video acquisition functions. For example, the device may include components such as cameras for acquiring images or videos. Or the device may obtain the required video stream or image from other devices by means of data transmission or data interaction with other devices, or access the required video stream or image from the storage resources of other devices. Among them, other devices have image acquisition or video acquisition functions, and have communication connections with the device. For example, the device can transmit data or interact with other devices through Bluetooth, wireless networks, etc. The communication method between the two is not limited here, and may include but is not limited to the above-mentioned examples. In one implementation method, the device may include a mobile phone, a tablet computer, an interactive screen, etc., which are not limited here.

[0051] See also Figure 1 , Figure 1 This is a flow chart of an embodiment of a training method for an image processing model of the present application. Specifically, it may include the following steps:

[0052] Step S11: Acquire multiple sample images, wherein the multiple sample images belong to at least two image types, and the sample images correspond to annotation results, and the annotation results of the sample images include real information about the content of the sample images.

[0053] There are many ways to obtain sample images, for example, obtaining the storage location of the sample image in the execution device executing the training method, and then obtaining the sample image by accessing the storage location, or obtaining the sample image from other devices through transmission methods such as Bluetooth and wireless networks.

[0054] The image type to which the sample image belongs can be determined according to the representation of the target in the sample image, for example, the target is a model of different dimensions constructed by hand-drawing or using other modeling software, etc.

[0055] Step S12: using the image processing model to process each sample image respectively to obtain a prediction result of each sample image, wherein the prediction result of the sample image includes prediction information about the content of the sample image.

[0056] Among them, the image processing model includes but is not limited to a convolutional neural network model. For example, the MobileNetV3 network can be used as an image processing model to reduce the model size, accelerate model prediction, and be more suitable for devices with smaller processing capabilities, such as mobile phones, tablets and other mobile terminals.

[0057] The image processing model can process each sample image at the same time to obtain a batch of prediction results, or it can process each sample image in time division to obtain the prediction results corresponding to each sample image respectively.

[0058] Step S13: Based on the labeling results and prediction results of each sample image, adjust the parameters of the image processing model.

[0059] Among them, the parameters of the image processing model can be adjusted according to the loss between the annotation results and the prediction results of each sample image.

[0060] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0061] Among them, the image type includes one or more of an image obtained by photographing the target, a hand-drawn picture, and a cartoon picture. The image obtained by photographing the target can be divided into visible light images and infrared images, etc. The hand-drawn picture can be a picture hand-drawn on paper and photographed to obtain a hand-drawn picture, or it can be a picture drawn on a drawing software, for example, a simple Mickey Mouse drawn by an artist on a drawing board. In the disclosed embodiment, the hand-drawn picture is further limited to a picture with a preset background color and a preset foreground color, and the foreground is composed of monochrome lines, for example, the background is white and the foreground is Mickey Mouse composed of black lines. A cartoon picture can be a virtual image with multiple foreground colors.

[0062] Specifically, to better understand the images, hand-drawn pictures, and cartoon pictures obtained by photographing the target described in the embodiments of the present disclosure, please also refer to Figure 2-4 , Figure 2 is a schematic diagram showing an image obtained by photographing a target in an embodiment of a training method for an image processing model of the present application, Figure 3 is a schematic diagram of a hand-drawn picture shown in an embodiment of a training method for an image processing model of the present application, Figure 4 is a schematic diagram of a cartoon image shown in an embodiment of the training method of the image processing model of the present application. Figure 2 As shown, Figure 2 This is an image taken from a real apple. Figure 3 is a sketch of an apple drawn on real paper. Figure 4 It is a cartoon image of an apple. By using sample images corresponding to common image types to train the image processing model, the trained image processing model is more applicable in daily life or work. In the disclosed embodiment, about 10,000 images obtained by photographing the target, about 20,000 hand-drawn pictures, and about 20,000 cartoon pictures are selected for training.

[0063] In some disclosed embodiments, each sample image is processed using an image processing model to obtain a prediction result of each sample image. Based on the annotation result and the prediction result of each sample image, the method of adjusting the parameters of the image processing model includes:

[0064] Select several sample images from multiple sample images as current sample images. Among them, several refers to 1 or more. That is, here one of the sample images can be selected from multiple sample images as the current sample image, or two or more sample images can be selected as the current sample image. Furthermore, the image type to which the selected several sample images belong includes all image types of the multiple sample images. For example, when the image types of multiple sample images include the above three image types in total, the several sample images selected from the multiple sample images also include the above three image types. Among them, the number of sample images of each image type can be the same or different. Then, the current sample image is processed using the image processing model to obtain a prediction result of the current sample image. Specifically, the current sample image is taken as a batch, and the sample images of this batch are processed using the image processing model to obtain a batch of prediction results. Then, based on the annotation result and prediction result of the current sample image, the parameters of the image processing model are adjusted. Optionally, the parameters of the model can be adjusted by using the loss between each annotation result and its corresponding prediction result in a batch, which requires several parameter adjustments. Alternatively, the parameters of the model can be adjusted by combining the loss between each annotation result and its corresponding prediction result, which requires only one adjustment of the parameters of the model. Repeat the steps of selecting several sample images from multiple sample images as current sample images and subsequent steps until the image processing model meets the preset requirements. The preset requirements here can be the error size between the prediction result and the annotation result given by the model. The specific error size is determined according to actual needs and is not specified here. Optionally, the several sample images selected from the multiple sample images each time can be the same as some of the sample images selected last time. In other disclosed embodiments, the several sample images selected from the multiple sample images each time are different. Select several sample images from the multiple sample images as the current sample images, and use the image processing model to process the current sample images, so as to train the image processing model in batches, and each batch of training ensures that there are sample images of all image types, which can improve the training effect of each batch on the image processing model.

[0065] In some disclosed embodiments, the sample image may be pre-processed or not pre-processed.

[0066] The preprocessing method can be at least one of Gaussian blur processing, cropping and rotation. Among them, Gaussian blur processing can also be called Gaussian smoothing. Its main function is to reduce image noise and reduce the level of detail. The main method is to adjust the pixel color value according to the Gaussian curve to selectively blur the image. Cropping refers to cropping the training sample image into images of different sizes, for example, cropping the training sample image into an image of size 1024*2048 or 512*512. Of course, this size is only an example. In other embodiments, it is entirely possible to crop the image into images of other sizes. Therefore, the cropping size is not specifically specified here. Rotation can be rotating the training sample image by 90°, 180° or 270°. Of course, in other embodiments, the preprocessing method can also be adjusting the resolution, etc.

[0067] In some disclosed embodiments, the image processing model includes at least one of a target classification model and a saliency detection model. The target classification model is used to classify the target in the sample image. For example, if the real information of the target in the sample image is an apple, the preset information about the content of the sample image included in the prediction result of the target classification model may be the predicted classification information of the target, such as an apple. The saliency detection model may be used to detect the location of the salient area in the sample image.

[0068] When the image processing model is a target classification model, the true information is the true category of the target in the sample image, and the predicted information includes the predicted category of the target in the sample image.

[0069] When the image processing model is a saliency detection model, the true information is the true position information about the salient region in the sample image, and the predicted information includes the predicted category of the target in the sample image.

[0070] By using sample images of multiple image types to train the target classification model, the trained target classification model can classify targets for multiple types of images, thereby improving the applicability of the target classification model. Also, by using sample images of multiple image types to train the saliency detection model, the trained saliency detection model can perform saliency detection for multiple types of images, thereby improving the applicability of the saliency detection model.

[0071] In some disclosed embodiments, when the image processing model is a saliency detection model, sample images belonging to hand-drawn images are screened to remove sample images of low quality. Specifically, based on the real position information of the salient area in the sample image, the missing condition of the contour of the salient area is determined for screening, and sample images whose missing condition does not meet the preset requirements are removed. By screening the hand-drawn images, the hand-drawn images with relatively complete contours of the salient area are retained, so that the detection results of the trained saliency detection model are more accurate.

[0072] In some disclosed embodiments, the annotation information of the sample image also includes the real image type of the sample image, and the prediction result of the sample image includes the predicted image type of the sample image. The above step S13 may specifically include: adjusting the parameters of the image processing model by using the difference between the real information about the content of the sample image and the predicted information of its content, and the difference between the real image type of the sample image and the predicted image type of the sample image. Wherein, in the case where the image processing model is a target classification model, the prediction result of the image processing model includes the predicted category of the target and the predicted image type of the sample image. In the case where the image processing model is a saliency detection model, the prediction information is the predicted category of the target in the sample image and the predicted image type of the sample image. By using the real information about the content of the sample image and the predicted information of its content, and the real image type of the sample image and the predicted image type of the sample image, the parameters of the image processing model are adjusted, so that the distance between the features extracted from images containing the same target but belonging to different image types in the feature space can be closer, thereby making the adjusted image processing model more accurate in predicting the content of images of different image types.

[0073] In some disclosed embodiments, based on the labeling results and prediction results of each sample image, the method of adjusting the parameters of the image processing model can be: based on the real information and the predicted information, a first loss is obtained, and based on the real image type and the predicted image type, a second loss is obtained. Then, based on the first loss and the second loss, the parameters of the image processing model are adjusted.

[0074] Specifically, a first loss is obtained based on the error between the real information and the predicted information. And a second loss is obtained based on the error between the real image type and the predicted image type. Specifically, a first loss is determined by combining the error between the predicted information of a batch and the corresponding annotation information, and a second loss is determined by combining the error between the predicted image type of a batch and the real image type. The parameters of the image processing model are adjusted by combining the first loss and the second loss. By adjusting the parameters of the image processing model using the first loss between the real information about the content of the sample image and the predicted information of its content and the second loss based on the real image type and the predicted image type, the prediction accuracy of the trained image processing model can be improved.

[0075] Specifically, the first loss optimizes the parameters of the model so that the predicted information obtained by the image processing model is closer to the real information, that is, the error between the two becomes smaller. By using the second loss to adjust the parameters of the model, the feature vectors of images representing the same object but belonging to different image types are closer in the feature space, so that the feature vectors of images of different image types are all in a feature space with a closer distance. For example, the feature vectors obtained by extracting features from hand-drawn pictures, cartoon pictures, and images obtained by photographing apples by the trained image processing model are closer in the feature space.

[0076] In some disclosed embodiments, based on the first loss and the second loss, the method for adjusting the parameters of the image processing model may be: obtaining the loss difference between the first loss and the second loss. Then, the parameters of the image processing model are adjusted using the loss difference and the second loss. Specifically, the loss difference is obtained by subtracting the first loss from the second loss. Using the first loss difference and the second loss difference, adjusting the parameters of the image processing model may be to first use one of the losses to adjust the parameters of the model, and then use the other loss to adjust the parameters of the model. By using the loss difference between the first loss and the second loss and the second loss to adjust the parameters of the image processing model, the prediction accuracy of the trained image processing model can be improved.

[0077] In some disclosed embodiments, the image processing model is a target classification model, which includes a feature extraction network, a target classification network, and an image type classification network.

[0078] The method of processing each sample image using the image processing model to obtain the prediction result of each sample image may be: extracting features from the sample image using a feature extraction network to obtain sample features. Using a target classification network to classify the sample features to obtain prediction information of the sample image. And using an image type classification network to classify the sample features to obtain the predicted image type of the sample image. Further, the sample features extracted by the feature extraction network are input into the target classification network to obtain prediction information about the sample image, and the sample features extracted by the feature extraction network are input into the image type classification network to obtain the predicted image type about the sample image. The method of adjusting the parameters of the image processing model using the loss difference and the second loss may be: adjusting the parameters of the image type classification network using the second loss. And using the loss difference, adjusting the parameters of the feature extraction network and the target classification network. The method of adjusting the parameters using the loss difference and the second loss is positive adjustment. By using the loss difference to adjust the feature extraction network and the target classification network in the image processing model, the image processing model can obtain more accurate prediction information about the content of the sample image, and by using the second loss to adjust the parameters of the image type classification network, the accuracy of the image type classification network can be improved.

[0079] In some disclosed embodiments, the trained image processing model can be deployed on a mobile phone to perform image processing. The image processing method can also be applied to software such as content sharing, video, live broadcast, entertainment, education, and games.

[0080] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0081] The execution subject of the training method of the image processing model may be a training device of the image processing model, for example, the training method of the image processing model may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the training method of the image processing model may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0082] See also Figure 5 , Figure 5 It is a flowchart of an embodiment of the image processing method of the present application.

[0083] like Figure 5 As shown, the image processing method provided by the embodiment of the present disclosure includes the following steps:

[0084] Step S21: Acquire the image to be processed.

[0085] There are many ways to obtain the image to be processed, for example, by photographing it through a camera component in an execution device that executes the image processing method, or by obtaining the image to be processed from other devices according to various communication methods. The image type of the image to be processed may be one of a plurality of image types. For example, the image type of the image to be processed may be one or more of an image photographed of a target, a hand-drawn cartoon image, etc. In some disclosed embodiments, the image to be processed may also be obtained from a video. For example, a video is input into an image processing model, and the image processing model obtains each frame of the video, and uses each frame of the video as an image to be processed.

[0086] Step S22: Process the image to be processed using the image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model is trained using the image processing model training method.

[0087] The image processing model is trained using sample images of various image types. Specifically, the image to be processed is input into the image processing model from the input end of the image processing model. The image processing model processes the image to be processed to obtain prediction information of the image to be processed.

[0088] The above scheme can improve the accuracy of image processing by processing the image to be processed using the image processing model trained by the above image processing model training method.

[0089] In some disclosed embodiments, the image processing model includes at least one of a target classification model and a saliency detection model. In the case where the image processing model is a target classification model, the prediction information is the predicted category of the target in the image to be processed. In the case where the image processing model is a saliency detection model, the prediction information is the predicted position information about the salient area in the image to be processed. By processing the image to be processed with the target classification model trained by the training method of the above-mentioned image processing model, the predicted category of the target obtained is more accurate. And / or, by processing the image to be processed with the saliency detection model trained by the training method of the above-mentioned image processing model, the predicted position information about the salient area obtained is more accurate.

[0090] As described in the previous embodiment, when the image processing model is a target classification model, the image processing model includes a feature extraction network, a target classification network, and an image type classification network. After the training is completed, the image classification network can be removed or the connection between the image classification network and the feature extraction network can be disconnected. That is, in the embodiment of the present disclosure, only the feature extraction network and the target classification network are used, and the output of the feature extraction network is used as the input of the target classification network.

[0091] In some disclosed embodiments, when the image processing model is a target classification model, after the image to be processed is processed using the image processing model to obtain prediction information about the content of the image to be processed, the image processing method further includes at least one of the following steps:

[0092] 1. Display the predicted category on the interface displaying the image to be processed. There are many ways to display it, such as marking the predicted category on the image to be processed so that the image to be processed and the corresponding predicted category are displayed together on the display interface. Of course, the image to be processed and the corresponding predicted category can also be displayed in different areas of the display interface. In some public embodiments, if there are two or more images to be processed, the corresponding images to be processed and their predicted categories can be displayed in different areas of the display interface, or the images to be processed and their predicted categories can be displayed in the form of flipping pages. When the image to be processed is obtained from a video, it is determined whether the prediction information of the video frames of a preset number of consecutive frames is the same. If so, the prediction information is considered correct. If not, the prediction information is considered incorrect. You can choose to output the correct prediction information and not output the wrong prediction information, or you can choose to annotate the correct and wrong prediction information accordingly and output them. The preset number of frames can be 5 frames, 10 frames, etc., which can be determined according to the specific usage scenario.

[0093] 2. Select the audio that matches the predicted category to play. The matching relationship between the audio and the predicted category can be set. After the image processing model obtains the predicted category of the content in the image to be processed, the corresponding audio can be played.

[0094] 3. Select the source skeleton that matches the predicted category, and migrate the first animation drive data related to the source skeleton to the target skeleton to obtain the second animation drive data of the target skeleton. Wherein, the target skeleton is obtained by extracting the skeleton based on the target in the image to be processed. The method of selecting the source skeleton that matches the predicted category can be to match the predicted category of the target with the category of each source skeleton stored in the database to obtain the source skeleton that matches the predicted category. For example, if the predicted category is cat, cat can be used as a keyword to search in the database to obtain the corresponding source skeleton.

[0095] In some disclosed embodiments, when the image processing model is a saliency detection model, after the image to be processed is processed using the image processing model to obtain prediction information about the content of the image to be processed, the following steps are further included:

[0096] Using the predicted position information, skeleton extraction is performed on the significant area to obtain a target skeleton. A skeleton model is selected as a source skeleton for the target skeleton. The source skeleton is provided with animation data. Then, the first animation driving data related to the source skeleton is migrated to the target skeleton to obtain the second animation driving data of the target skeleton.

[0097] In some disclosed embodiments, the step of extracting bones from the salient region using the predicted position information to obtain the target skeleton may include: extracting contours from the salient region to obtain the contour of the target, and then using the contours to generate a three-dimensional mesh model for the target. Finally, extracting the target skeleton from the three-dimensional mesh model.

[0098] Wherein, the method of obtaining the source skeleton can specifically be to classify the processed image, obtain the category of the target object, and select the skeleton model matching the category as the source skeleton. Wherein, the target skeleton can be understood as the skeleton of the target object, that is, the type of the target object can be understood as the type of the target skeleton. Specifically, the disclosed embodiment can adopt the predicted label mapping, and can also adopt the data set label mapping. The classification result of the predicted label mapping for the target object includes the predicted skeleton topological structure type of the target object, for example, the predicted skeleton topological structure type includes two feet, four feet, etc. That is, the process of predicting the label mapping is mainly to predict the skeleton topological structure characteristics of the target object. The classification result of the data set label mapping needs to give the specific type of the target object in the input image, for example, the target object is a cat, a dog, a giant panda, a bear, etc. The disclosed embodiment chooses to adopt the predicted label mapping. In the specific application process, if the target object is a giant panda, and the target object category given by the predicted label mapping is four feet, and the skeleton model matching the category is selected as the source skeleton, if the selected source skeleton is a four-footed bear. Although giant pandas and bears are different, they actually have roughly the same bone topology. Therefore, the bear animation drive data can be transferred to the giant panda in a natural and reasonable form. In other words, although the predicted label mapping cannot obtain the completely correct category of the target object, it does not affect the driving of the final target skeleton. At the same time, because the predicted label mapping does not further know the specific category of the target object, the computational cost is reduced.

[0099] After determining the source skeleton that matches the target skeleton, the source skeleton and the target skeleton are mapped to the skeleton nodes to obtain the node mapping relationship between the two. In some public embodiments, the way to obtain the node mapping relationship between the two can be: determine the number of skeleton branches where each node is located in the source skeleton and the target skeleton. According to the order of the number of skeleton branches from most to least, the nodes in the source skeleton and the target skeleton are mapped in sequence. Among them, the node with the largest number of skeleton branches is generally called the root node. Among them, the number of skeleton branches where the node is located is temporarily called the degree. That is, the mapping relationship between the nodes with larger degrees in the two skeletons is first constructed, and then the mapping relationship between the nodes with less degrees is constructed. Alternatively, the principle of minimum skeleton branch mapping error value can be adopted for mapping. Among them, if the number of nodes between the source skeleton and the target skeleton is different, the minimum many-to-one mapping with the lowest cost is selected. For example, mapping can be performed by performing a one-to-one joint matching method in a sequence where many-to-one or skip mapping occurs.

[0100] By obtaining the category of the target object and selecting the source bone from the bone model matching the category, it is convenient and quick. By mapping the nodes in the bones and the target bones in order from the largest to the smallest number of bone branches, the accuracy of the mapping can be improved.

[0101] In some disclosed embodiments, the node topology of the final target skeleton is consistent with that of the source skeleton. Or, the nodes between the final target skeleton and the final source skeleton are mapped one by one. That is, the node topology of the final target skeleton and the final source skeleton may exist in two forms, one is that the node topology of the final target skeleton is completely consistent with that of the final source skeleton, and the other is that the nodes in the final target skeleton all have corresponding nodes of the final source skeleton, but there are some nodes in the final source skeleton that do not have a mapping relationship. That is, it is necessary to ensure that after the animation migration, the nodes of the final target skeleton all have corresponding animation drive data.

[0102] After obtaining the node mapping relationship between the two, topology alignment and node alignment are performed.

[0103] The method of aligning the topological structure may include at least one of the following steps:

[0104] First, when there are multiple nodes mapped to the same node between the source bone and the target bone, the node topology of one of the bones is updated. Among them, the nodes between the two bones after the update are mapped one by one. By updating the node topology of the bones, the situation where multiple nodes between the two bones are mapped to the same node can be adjusted to a one-to-one mapping of the nodes between the two bones, so as to reduce the unreasonable situation in the process of subsequent animation driving the final target bone.

[0105] Among them, updating the node topology structure of one of the bones can be divided into multiple situations: the first situation is that when multiple nodes are located in the same bone branch, the first bone where the multiple nodes are located is updated. Among them, one of the first bone and the second bone is the source bone, and the other is the target bone. By updating the first bone where the multiple nodes are located, the situation where the multiple nodes between the two bones are mapped to the same node is adjusted to a one-to-one mapping of the nodes between the two bones, thereby reducing the unreasonable situation in the process of subsequent animation driving the final target bone. Optionally, the method of updating the first bone where the multiple nodes are located can be to merge the multiple nodes in the first bone into a first node. Among them, the first node retains the mapping relationship of the multiple nodes before the merger. And the position of the first node takes the average value of the positions of all merged nodes.

[0106] See also Figure 6 , Figure 6 FIG. 1 is a first schematic diagram showing a mapping relationship in an embodiment of the image processing method of the present application. Figure 6As shown, when the second node and the third node in the target skeleton are simultaneously mapped to the second node in the source skeleton. In this case, the second node and the third node in the target skeleton are merged into a first node. Wherein, the position of the first node is the average value of the positions of the second node and the third node in the target skeleton. Wherein, when the first skeleton is the source skeleton, because the nodes in the source skeleton carry animation drive data, after the nodes are merged, it is necessary to obtain the animation drive data of the first node. At this time, the animation drive data of all merged nodes can be merged. Specifically, the animation drive data can generally be represented by a matrix, and the merging of matrices can be represented by matrix multiplication, that is, the animation drive data is multiplied to obtain the animation drive data of the first node. The second case is that when multiple nodes are located in different skeleton branches, the second skeleton that does not include multiple nodes is updated. Wherein, one of the first skeleton and the second skeleton is the source skeleton, and the other is the target skeleton. Optionally, the second node where the skeleton branches where multiple nodes are located converges is found in the first skeleton. The specific method can be to traverse the parent nodes in sequence to obtain the second node. And find the third node mapped to the second node in the second skeleton. Then find the node topology structure corresponding to the multiple nodes, and add at least one skeleton branch at the third node. In the disclosed embodiment, the parent node of a node refers to a node in a skeleton branch that is adjacent to the node and closer to the root node than the node. Among them, multiple nodes are mapped one by one to the newly added skeleton branch at the third node and the nodes in the original skeleton branch. Among them, the newly added skeleton branch can be a copy of the original skeleton branch. The copied content includes animation data and the transformation relationship between the node and its parent node. For example, the original skeleton branch includes three nodes, and the newly added skeleton branch also includes three nodes, and the animation drive data of the three nodes in the newly added skeleton branch is obtained by copying the animation data of the corresponding nodes in the original skeleton branch.

[0107] See also Figure 7 , Figure 7 FIG. 1 is a second schematic diagram showing a mapping relationship in an embodiment of the image processing method of the present application. Figure 7 As shown, the node topology structure on the left is the node topology structure of the source bone, and the node topology structure on the right is the node topology structure of the target bone. Figure 3In the example, the first node of the target bone is mapped to the first node of the source bone, the second node of the target bone is mapped to the second node of the source bone, and the second node of the target bone includes two branches, namely the left branch and the right branch, wherein the first node in the left branch and the first node in the right branch are mapped to the third node of the source bone, and the second node in the left branch and the second node in the right branch are mapped to the fourth node of the source bone. This also results in two nodes in the target bone being mapped to the third node of the source bone, and the two nodes belong to different branches, and two nodes in the target bone being mapped to the fourth node of the source bone, and the two nodes belong to different branches. Among them, the two branches converge at the second node of the target bone. Find the second node mapped to the target bone in the source bone as the second node. According to the node topology corresponding to the two nodes of the target bone, a new bone branch is added at the second node of the source bone. Among them, there are two nodes in the newly added bone branch. At this time, all nodes in the target bone correspond one-to-one to the nodes in the source bone. Therefore, in this way, when the node one-to-one mapping is realized, the node topology of the first bone can be retained to the maximum extent.

[0108] Second, when there is no mapping relationship in the skeleton, the node topology structure of the skeleton where the node without mapping relationship is located is updated. Among them, the two skeletons include a source skeleton and a target skeleton, and the nodes between the two skeletons after updating are mapped one by one. By updating the node topology structure of the skeleton where the node without mapping relationship is located, the nodes without mapping relationship are reduced, so that the nodes between the two skeletons after updating are mapped one by one, thereby reducing the unreasonable situations that occur in the process of subsequent animation driving the final target skeleton. Optionally, the nodes without mapping relationship are merged into adjacent nodes with mapping relationship. Among them, the adjacent nodes are the parent nodes or child nodes of the nodes without mapping relationship in the skeleton. In the disclosed embodiment, the nodes without mapping relationship are merged to their parent nodes.

[0109] See also Figure 8 , Figure 8 FIG. 1 is a third schematic diagram showing a mapping relationship in an embodiment of the image processing method of the present application. Figure 8 As shown, the first node of the target bone is mapped to the first node of the source bone, the second node of the target bone is mapped to the third node of the source bone, and the third node of the target bone is mapped to the fourth node of the source bone. Among them, the second node of the source bone has no mapping relationship. The second node of the source bone can be merged to its parent node, that is, merged to the first node of the source bone. Of course, the node merging in the source bone will be accompanied by the merging between animation drive data, and the merging between animation drive data will not be repeated here.

[0110] Among them, node alignment is mainly performed to determine the first pose transformation relationship between the source bone and the target bone.

[0111] Specifically, in the order from the root source node to the leaf source node, each source node in the final source skeleton is aligned with the corresponding mapped target node in the final target skeleton to obtain the first pose transformation relationship between each source node and the mapped target node. As mentioned above, the root node is the node with the largest number of skeletal branches. The root source node refers to the root node in the final source skeleton, and similarly, the root target node refers to the root node of the final target skeleton. The final source skeleton and the final target skeleton refer to the source skeleton and the target skeleton after topological structure alignment. Among them, a leaf node refers to a node with a parent node but no child node. The leaf source node refers to the leaf node in the final source skeleton, and the leaf target node refers to the leaf node in the final target skeleton.

[0112] The first pose transformation relationship is the transformation relationship between the source node and the mapped target node in the first coordinate system. By translating the root source node of the final source skeleton and the root target node of the final target skeleton to the origin of the first coordinate system, the offset between the root source node of the final source skeleton and the root target node of the final target skeleton can be obtained. Specifically, for each source node in the final source skeleton, the offset required to align the source node with the mapped target node is obtained. Among them, the offset includes a translation component and a rotation component. Generally speaking, the translation component includes a scaling component. Then, based on the offset corresponding to the source node, the first pose transformation relationship of the source node is obtained.

[0113] Based on the offset corresponding to the source node, the first pose transformation relationship of the source node is obtained. Specifically, based on the offsets corresponding to the source node and the parent node of the source node, the first pose transformation relationship of the source node is obtained. Among them, the parent node of the source node is the first parent node of the source node in the final source skeleton, the root node, and the node between the first parent node and the root node. Among them, the offsets can be represented by a matrix. Specifically, by performing matrix multiplication on the offsets corresponding to the source node and the parent node of the source node, the first pose transformation relationship of the source node can be obtained.

[0114] If the topological structure of the source skeleton changes, the animation data on the source skeleton will also change accordingly. For example, if two source nodes in the source skeleton are merged, the animation data corresponding to the nodes will also be merged.

[0115] Thus, the animation data on the source skeleton can be transferred to the target skeleton to drive the target in the image to be processed to move.

[0116] After obtaining the prediction information, at least one of the above steps is performed to achieve further intelligent operation of the classification result of the image processing model.

[0117] And the salient area output by the saliency detection model trained by the training method of the above-mentioned image processing model is used to extract the skeleton of the saliency area to obtain the target skeleton, so that the obtained target skeleton is more accurate.

[0118] The above scheme can improve the accuracy of image processing by processing the image to be processed using the image processing model trained by the above image processing model training method.

[0119] The execution subject of the image processing method may be an image processing device, for example, the image processing method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc. In some possible implementations, the image processing method may be implemented by a processor calling a computer-readable instruction stored in a memory.

[0120] See also Fig. 9 , Fig. 9 It is a structural schematic diagram of an embodiment of a training device for an image processing model of the present application. The training device 30 for an image processing model includes a first acquisition module 31, a first image processing module 32, and an adjustment module 33. The first acquisition module 31 is used to acquire multiple sample images, wherein the multiple sample images belong to at least two types of images, and the sample images correspond to annotation results, and the annotation results of the sample images include real information about the content of the sample images; the first image processing module 32 is used to process each sample image using the image processing model respectively to obtain a prediction result of each sample image, wherein the prediction result of the sample image includes prediction information about the content of the sample image; the adjustment module 33 is used to adjust the parameters of the image processing model based on the annotation results and prediction results of each sample image.

[0121] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0122] In some disclosed embodiments, the image processing model includes at least one of a target classification model and a saliency detection model; when the image processing model is a target classification model, the true information is the true category of the target in the sample image, and the predicted information includes the predicted category of the target in the sample image; when the image processing model is a saliency detection model, the true information is the true position information about the salient area in the sample image, and the predicted information includes the predicted position information about the salient area in the sample image.

[0123] The above scheme trains the target classification model by using sample images of multiple image types, so that the trained target classification model can classify targets for multiple types of images, thereby improving the applicability of the target classification model. Also, by using sample images of multiple image types to train the saliency detection model, the trained saliency detection model can perform saliency detection for multiple types of images, thereby improving the applicability of the saliency detection model.

[0124] In some disclosed embodiments, the annotation information of the sample image also includes the real image type of the sample image, and the prediction result of the sample image includes the predicted image type of the sample image.

[0125] The above scheme adjusts the parameters of the image processing model by combining the real image type of the sample image and the predicted image type of the sample image, so that the distance between the features extracted from images containing the same target but belonging to different image types in the feature space is closer, thereby making the adjusted image processing model more accurate in predicting the content of images of different image types.

[0126] In some disclosed embodiments, the adjustment module 33 adjusts the parameters of the image processing model based on the labeling results and prediction results of each sample image, including: obtaining a first loss based on real information and predicted information, and obtaining a second loss based on the real image type and the predicted image type; adjusting the parameters of the image processing model based on the first loss and the second loss.

[0127] The above scheme adjusts the parameters of the image processing model by using a first loss between the real information about the content of the sample image and the predicted information of its content and a second loss based on the real image type and the predicted image type, thereby improving the prediction accuracy of the trained image processing model.

[0128] In some disclosed embodiments, the adjustment module 33 adjusts the parameters of the image processing model based on the first loss and the second loss, including: obtaining the loss difference between the first loss and the second loss; and adjusting the parameters of the image processing model using the loss difference and the second loss.

[0129] The above scheme can improve the prediction accuracy of the trained image processing model by adjusting the parameters of the image processing model using the loss difference between the first loss and the second loss and the second loss.

[0130] In some disclosed embodiments, the image processing model is a target classification model, which includes a feature extraction network, a target classification network, and an image type classification network; the first image processing module 32 uses the image processing model to process each sample image respectively to obtain a prediction result of each sample image, including: using the feature extraction network to extract features of the sample image to obtain sample features; using the target classification network to perform target classification on the sample features to obtain prediction information of the sample image; using the image type classification network to perform image type classification on the sample features to obtain a predicted image type of the sample image; the adjustment module 33 uses the loss difference and the second loss to adjust the parameters of the image processing model, including: using the second loss to adjust the parameters of the image type classification network; using the loss difference to adjust the parameters of the feature extraction network and the target classification network.

[0131] The above scheme uses the loss difference to adjust the feature extraction network and the target classification network in the image processing model, so that the image processing model obtains more accurate prediction information about the content of the sample image, and uses the second loss to adjust the parameters of the image type classification network, thereby improving the accuracy of the image type classification network.

[0132] In some disclosed embodiments, the first image processing module 32 processes each sample image using an image processing model to obtain a prediction result of each sample image, and adjusts the parameters of the image processing model based on the annotation results and the prediction results of each sample image, including: selecting several sample images from multiple sample images as current sample images; wherein the image types to which the several sample images belong include all image types of the multiple sample images; processing the current sample image using the image processing model to obtain a prediction result in the current sample image; the adjustment module 33 adjusts the parameters of the image processing model based on the annotation results and the prediction results of the current sample image; and repeating the step of selecting several sample images from multiple sample images as the current sample image and subsequent steps until the image processing model meets preset requirements.

[0133] The above scheme selects several sample images from multiple sample images as current sample images, and uses the image processing model to process the current sample images, so as to train the image processing model in batches. Moreover, each batch of training ensures the presence of sample images of all image types, which can improve the training effect of each batch on the image processing model.

[0134] In some disclosed embodiments, the image type includes one or more of an image obtained by photographing the target, a hand-drawn image, and a cartoon image.

[0135] The above scheme uses sample images corresponding to common image types to train the image processing model, so that the trained image processing model is more applicable in daily life or work.

[0136] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0137] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of an embodiment of an image processing device of the present application. The image processing device 40 includes a second acquisition module 41 and a second image processing module 42. The second acquisition module 41 is used to acquire the image to be processed; the second image processing module 42 is used to process the image to be processed using an image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model is trained by the training method of the above-mentioned image processing model.

[0138] The above scheme can improve the accuracy of image processing by processing the image to be processed using the image processing model trained by the above image processing model training method.

[0139] In some disclosed embodiments, the image processing model includes at least one of a target classification model and a saliency detection model; when the image processing model is a target classification model, the prediction information is the predicted category of the target in the image to be processed; when the image processing model is a saliency detection model, the prediction information is the predicted position information about the salient area in the image to be processed.

[0140] In the above scheme, by using the target classification model trained by the training method of the above image processing model to process the image to be processed, the predicted category of the target obtained is more accurate. And / or, by using the saliency detection model trained by the training method of the above image processing model to process the image to be processed, the predicted position information about the saliency area obtained is more accurate.

[0141] In some disclosed embodiments, when the image processing model is a target classification model, after the image to be processed is processed using the image processing model to obtain predicted information about the content of the image to be processed, the second image processing module 42 is also used to perform at least one of the following steps: displaying the predicted category on the interface displaying the image to be processed; selecting audio matching the predicted category for playing; selecting a source bone matching the predicted category, and migrating the first animation driving data related to the source bone to the target bone to obtain the second animation driving data of the target bone, wherein the target bone is obtained by bone extraction based on the target in the image to be processed.

[0142] The above scheme, after obtaining the prediction information, further performs at least one of the above steps to achieve further intelligent operation of the classification result of the image processing model.

[0143] In some disclosed embodiments, when the image processing model is a saliency detection model, the second image processing module 42, after using the image processing model to process the image to be processed to obtain predicted information about the content of the image to be processed, is also used to: use the predicted position information to extract bones from the salient area to obtain a target bone; select a bone model as a source bone for the target bone; migrate the first animation driving data related to the source bone to the target bone to obtain the second animation driving data of the target bone.

[0144] The above scheme uses the salient region output by the saliency detection model trained by the training method of the above image processing model, and uses this to extract the skeleton of the saliency region to obtain the target skeleton, so that the obtained target skeleton is more accurate.

[0145] See also Fig.11 , Fig.11 : is a schematic diagram of the structure of an embodiment of an electronic device of the present application. The electronic device 50 includes a memory 51 and a processor 52, and the processor 52 is used to execute the program instructions stored in the memory 51 to implement the steps in the training method embodiment of any of the above-mentioned image processing models and / or the steps in the image processing method embodiment. In a specific implementation scenario, the electronic device 50 may include but is not limited to: medical equipment, microcomputers, desktop computers, servers, and in addition, the electronic device 50 may also include mobile devices such as laptops and tablet computers, which are not limited here.

[0146] Specifically, the processor 52 is used to control itself and the memory 51 to implement the steps in the training method embodiment of any of the above-mentioned image processing models. The processor 52 can also be called a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip with signal processing capabilities. The processor 52 can also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field-programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 52 can be implemented by an integrated circuit chip.

[0147] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0148] See also Fig.12 , Fig.12 The computer-readable storage medium 60 stores program instructions 61 that can be executed by a processor, and the program instructions 61 are used to implement the steps in the training method embodiment of any of the above-mentioned image processing models and / or the steps in the image processing method embodiment.

[0149] The above scheme trains the image processing model by using sample images of various image types, so that the trained image processing model can perform image processing on various types of images, thereby improving the applicability of the image processing model.

[0150] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0151] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0152] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0153] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.

Claims

1. A training method for an image processing model, characterized in that: include: Acquire a plurality of sample images, wherein the plurality of sample images belong to at least two image types, the sample images correspond to annotation results, the annotation results of the sample images include real information about the content of the sample images, the annotation information of the sample images also includes the real image type of the sample images, and the prediction results of the sample images include the predicted image type of the sample images; Using the image processing model to process each of the sample images respectively to obtain a prediction result of each of the sample images, wherein the prediction result of the sample image includes prediction information about the content of the sample image, and the image processing model includes at least one of a target classification model and a saliency detection model; Adjusting parameters of the image processing model based on the annotation results and the prediction results of each of the sample images; The adjusting the parameters of the image processing model based on the labeling results and the prediction results of each of the sample images includes: obtaining a first loss based on the real information and the prediction information, and obtaining a second loss based on the real image type and the prediction image type; adjusting the parameters of the image processing model based on the first loss and the second loss; The adjusting the parameters of the image processing model based on the first loss and the second loss includes: obtaining a loss difference between the first loss and the second loss; and adjusting the parameters of the image processing model using the loss difference and the second loss.

2. The method according to claim 1, characterized in that In the case where the image processing model is the target classification model, the real information is the real category of the target in the sample image, and the prediction information includes the predicted category of the target in the sample image; In the case where the image processing model is the saliency detection model, the real information is the real position information about the salient area in the sample image, and the predicted information includes the predicted position information about the salient area in the sample image.

3. The method according to claim 1, characterized in that The image processing model is a target classification model, which includes a feature extraction network, a target classification network and an image type classification network; The respectively using the image processing model to process each of the sample images to obtain a prediction result of each of the sample images includes: Using the feature extraction network to extract features from the sample image to obtain sample features; Using the target classification network to perform target classification on the sample features to obtain the prediction information of the sample image; Using the image type classification network to classify the sample features into image types, and obtain a predicted image type of the sample image; The adjusting the parameters of the image processing model by using the loss difference and the second loss includes: Using the second loss, adjusting parameters of the image type classification network; The loss difference is used to adjust the parameters of the feature extraction network and the target classification network.

4. The method according to any one of claims 1 to 3, characterized in that: The respectively using the image processing model to process each of the sample images to obtain a prediction result of each of the sample images, and adjusting the parameters of the image processing model based on the annotation result and the prediction result of each of the sample images, comprises: Selecting a number of the sample images from the multiple sample images as current sample images; wherein the image types to which the multiple sample images belong include all image types of the multiple sample images; Processing the current sample image using the image processing model to obtain a prediction result in the current sample image; Adjusting the parameters of the image processing model based on the annotation result and the prediction result of the current sample image; The step of selecting a number of the sample images from the plurality of sample images as current sample images and subsequent steps are repeated until the image processing model meets preset requirements.

5. The method according to any one of claims 1 to 3, characterized in that: The image type includes one or more of an image obtained by photographing the target, a hand-drawn picture, and a cartoon picture.

6. An image processing method, characterized in that: include: Get the image to be processed; The image to be processed is processed using an image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model includes at least one of a target classification model and a saliency detection model, and the image processing model is trained by any one of the methods of claims 1 to 5.

7. The method according to claim 6, characterized in that In the case where the image processing model is the target classification model, the prediction information is the predicted category of the target in the image to be processed; In the case where the image processing model is the saliency detection model, the prediction information is predicted position information about a salient area in the image to be processed.

8. The method according to claim 7, characterized in that In the case where the image processing model is the target classification model, after the image to be processed is processed using the image processing model to obtain prediction information about the content of the image to be processed, the method further includes at least one of the following: Displaying the predicted category on an interface displaying the image to be processed; Selecting audio matching the predicted category for playback; A source bone matching the predicted category is selected, and first animation driving data associated with the source bone is migrated to a target bone to obtain second animation driving data for the target bone, wherein the target bone is obtained by bone extraction based on a target in the image to be processed.

9. The method according to claim 7, characterized in that: In the case where the image processing model is the saliency detection model, after the image to be processed is processed using the image processing model to obtain prediction information about the content of the image to be processed, the method further includes: Using the predicted position information, extracting bones from the salient area to obtain a target bone; Selecting a bone model as a source bone for the target bone; The first animation driving data related to the source bone is migrated to the target bone to obtain the second animation driving data of the target bone.

10. A training device for an image processing model, characterized in that: include: a first acquisition module, configured to acquire a plurality of sample images, wherein the plurality of sample images belong to at least two image types, the sample images correspond to annotation results, the annotation results of the sample images include real information about the content of the sample images, the annotation information of the sample images also includes the real image type of the sample images, and the prediction results of the sample images include the predicted image type of the sample images; a first image processing module, configured to process each of the sample images using the image processing model to obtain a prediction result of each of the sample images, wherein the prediction result of the sample image includes prediction information about the content of the sample image, and the image processing model includes at least one of a target classification model and a saliency detection model; An adjustment module, used for adjusting the parameters of the image processing model based on the annotation results and prediction results of each of the sample images; The adjustment module adjusts the parameters of the image processing model based on the annotation results and the prediction results of each sample image in a manner including: obtaining a first loss based on the real information and the prediction information, and obtaining a second loss based on the real image type and the prediction image type; and adjusting the parameters of the image processing model based on the first loss and the second loss; The adjustment module adjusts the parameters of the image processing model based on the first loss and the second loss in the following manner: obtaining a loss difference between the first loss and the second loss; and adjusting the parameters of the image processing model using the loss difference and the second loss.

11. An image processing device, characterized in that: include: A second acquisition module, used for acquiring an image to be processed; A second image processing module is used to process the image to be processed using an image processing model to obtain prediction information about the content of the image to be processed, wherein the image processing model includes at least one of a target classification model and a saliency detection model, and the image processing model is trained by any one of the methods of claims 1 to 5.

12. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the method according to any one of claims 1 to 9.

13. A computer-readable storage medium having program instructions stored thereon, characterized in that: When the program instructions are executed by a processor, the method according to any one of claims 1 to 9 is implemented.